MySQL 8.4.2
Source Code Documentation
|
A service that provides the API to execute prepared statements. More...
#include <mysql_statement_service.h>
Public Attributes | |
mysql_service_status_t(* | execute )(my_h_statement statement) |
Execute the prepared statement. More... | |
mysql_service_status_t(* | prepare )(mysql_cstring_with_length query, my_h_statement statement) |
Prepare the statement with the query. More... | |
mysql_service_status_t(* | reset )(my_h_statement statement) |
For prepared statements, calling reset would reset the binding parameters, close the cursor if one is open and frees the result sets. More... | |
A service that provides the API to execute prepared statements.
Usage example: Prepare a statement my_h_statement statement = nullptr; SERVICE_PLACEHOLDER(mysql_stmt_factory)->init(&statement); SERVICE_PLACEHOLDER(mysql_stmt_execute)->prepare("SELECT * FROM my_table WHERE col_c = ?", statement) SERVICE_PLACEHOLDER(mysql_stmt_bind)->bind_param(statement, 0, false, MYSQL_TYPE_LONG, false, 4, 1, nullptr, 0);
To reset the parameter to bind it with new values SERVICE_PLACEHOLDER(mysql_stmt_execute)->reset(statement)
Execute the statement SERVICE_PLACEHOLDER(mysql_stmt_execute)->execute(statement)
mysql_service_status_t(* s_mysql_mysql_stmt_execute::execute) (my_h_statement statement) |
Execute the prepared statement.
[in] | statement | A handle to the statement |
false | success |
true | failure |
mysql_service_status_t(* s_mysql_mysql_stmt_execute::prepare) (mysql_cstring_with_length query, my_h_statement statement) |
Prepare the statement with the query.
[in] | query | The query string to be prepared |
[in] | statement | A handle to the statement |
false | success |
true | failure |
mysql_service_status_t(* s_mysql_mysql_stmt_execute::reset) (my_h_statement statement) |
For prepared statements, calling reset would reset the binding parameters, close the cursor if one is open and frees the result sets.
For regular statements, calling reset is not supported. To close and clean up the statement, use mysql_stmt_factory::close.
[in] | statement | A handle to the statement |
false | success |
true | failure |