MySQL 9.1.0
Source Code Documentation
s_mysql_mysql_stmt_bind Struct Reference

A service that provides the API to bind the parameters in prepared statements. More...

#include <mysql_statement_service.h>

Public Attributes

mysql_service_status_t(* bind_param )(my_h_statement statement, uint32_t index, bool is_null, uint64_t type, bool is_unsigned, const void *data, unsigned long data_length, const char *name, unsigned long name_length)
 Bind a parameter. More...
 

Detailed Description

A service that provides the API to bind the parameters in prepared statements.

Usage example:

For first parameter SERVICE_PLACEHOLDER(mysql_stmt_bind)->bind_param(statement, 0, false, MYSQL_TYPE_LONG, false, 4, 1, nullptr, 0);

Member Data Documentation

◆ bind_param

mysql_service_status_t(* s_mysql_mysql_stmt_bind::bind_param) (my_h_statement statement, uint32_t index, bool is_null, uint64_t type, bool is_unsigned, const void *data, unsigned long data_length, const char *name, unsigned long name_length)

Bind a parameter.

Note
Calling bind with regular statements results in failure.
Bound values are cached. To update only some parameters, call bind on these, the rest will use the cached values.
Calling bind with the same index multiple times, only the last value is kept.
Parameters
[in]statementA handle to the statement
[in]index0-based index of the parameter to be bound
[in]is_nullWhether the parameter can be null
[in]typeType of the parameter. List of supported types: Table 6.1 at https://dev.mysql.com/doc/c-api/8.0/en/c-api-prepared-statement-type-codes.html
[in]boolWhether the value is unsigned
[in]dataThe data argument is the value for the member
[in]data_lengthLength of the data
[in]nameName of the parameter
[in]name_lengthName length of the parameter
Returns
Status of the performed operation
Return values
falsesuccess
truefailure

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