MySQL 9.1.0
Source Code Documentation
|
A service that provides the API to create, and deallocate a statement. More...
#include <mysql_statement_service.h>
Public Attributes | |
mysql_service_status_t(* | init )(my_h_statement *statement) |
Construct a new statement object. More... | |
mysql_service_status_t(* | close )(my_h_statement statement) |
Close and clean up resource related to a statement. More... | |
A service that provides the API to create, and deallocate a statement.
Usage example for prepared statement: my_h_statement statement = nullptr; SERVICE_PLACEHOLDER(mysql_stmt_factory)->init(&statement);
SERVICE_PLACEHOLDER(mysql_stmt_attributes)->set("charset_name", "utf8mb4");
SERVICE_PLACEHOLDER(mysql_stmt_execute)->prepare("SELECT * FROM ?", statement);
uint32_t parameter_count; SERVICE_PLACEHOLDER(mysql_stmt_metadata)->param_count(statement, ¶meter_count);
For first parameter SERVICE_PLACEHOLDER(mysql_stmt_bind)->bind_param(statement, 0, false, MYSQL_TYPE_LONG, false, 4, 1, nullptr, 0);
SERVICE_PLACEHOLDER(mysql_stmt_execute)->execute(statement)
my_h_row row = nullptr; SERVICE_PLACEHOLDER(mysql_stmt_result)->fetch(statement, &row); SERVICE_PLACEHOLDER(mysql_stmt_factory)->close(statement)
Usage example for regular statement: my_h_statement statement = nullptr; SERVICE_PLACEHOLDER(mysql_stmt_factory)->init(&statement);
SERVICE_PLACEHOLDER(mysql_stmt_attributes)->set("charset_name", "utf8mb4");
SERVICE_PLACEHOLDER(mysql_stmt_execute_direct)->execute("SELECT * FROM my_table", statement);
my_h_row row = nullptr; SERVICE_PLACEHOLDER(mysql_stmt_result)->fetch(statement, &row); SERVICE_PLACEHOLDER(mysql_stmt_factory)->close(statement)
mysql_service_status_t(* s_mysql_mysql_stmt_factory::close) (my_h_statement statement) |
Close and clean up resource related to a statement.
[in] | statement | A handle to the statement |
false | success |
true | failure |
mysql_service_status_t(* s_mysql_mysql_stmt_factory::init) (my_h_statement *statement) |
Construct a new statement object.
[out] | statement | A handle to the statement |
false | success |
true | failure |