MySQL 8.4.0
Source Code Documentation
s_mysql_mysql_stmt_result Struct Reference

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...
 

Detailed Description

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);

Member Data Documentation

◆ fetch

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.

Note
If there is no more rows, the returned row handle will be a nullptr. This is not considered a failure case.
Parameters
[in]statementA handle to the statement
[out]rowThe row handle
Returns
Status of the performed operation
Return values
falsesuccess if there is no error in fetching the row including no more rows.
truefailure in case of any error in fetching the row

◆ next_result

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.

Parameters
[in]statementA handle to the statement
[out]has_nextWhether there is more result set
Returns
Status of the performed operation
Return values
falsesuccess
truefailure

The documentation for this struct was generated from the following file: