MySQL 8.4.2
Source Code Documentation
|
A service that provides the API to manage and get info about a result set including fetch row(s) from a result set, get next result set. More...
#include <mysql_statement_service.h>
Public Attributes | |
mysql_service_status_t(* | next_result )(my_h_statement statement, bool *has_next) |
Check if there is more result set and move to next result set if there is. More... | |
mysql_service_status_t(* | fetch )(my_h_statement statement, my_h_row *row) |
Fetch one row from the current result set. More... | |
A service that provides the API to manage and get info about a result set including fetch row(s) from a result set, get next result set.
A result set contains the result of an execution. It is a list of rows, each row is a list of values where each value corresponds to a column.
Usage example: Iterate over the rows in a result set for result set with data (num_fields != 0) For in-depth example, check test_execute_prepared_statement.cc and test_execute_regular_statement.cc my_h_row row = nullptr; do { SERVICE_PLACEHOLDER(mysql_stmt_result)->fetch(statement, &row); if (row == nullptr) { break; } Get data from a row using row services } while (true)
Iterate over result sets auto has_next_result_set = bool{}; do { SERVICE_PLACEHOLDER(mysql_stmt_result)->next_result(statement, &has_next_result_set); } while(has_next_result_set);
mysql_service_status_t(* s_mysql_mysql_stmt_result::fetch) (my_h_statement statement, my_h_row *row) |
Fetch one row from the current result set.
[in] | statement | A handle to the statement |
[out] | row | The row handle |
false | success if there is no error in fetching the row including no more rows. |
true | failure in case of any error in fetching the row |
mysql_service_status_t(* s_mysql_mysql_stmt_result::next_result) (my_h_statement statement, bool *has_next) |
Check if there is more result set and move to next result set if there is.
[in] | statement | A handle to the statement |
[out] | has_next | Whether there is more result set |
false | success |
true | failure |