MySQL Shell API 9.0.1
Unified development interface for MySQL Products
|
Handler for execution SQL statements, supports parameter binding. More...
Methods | |
SqlExecute | sql (str statement) |
Sets the sql statement to be executed by this handler. More... | |
SqlExecute | bind (Value data) |
Registers a value or a list of values to be bound on the execution of the SQL statement. More... | |
SqlResult | execute () |
Executes the sql statement. More... | |
Handler for execution SQL statements, supports parameter binding.
This object should only be created by calling the sql function at a Session instance.
SqlExecute sql | ( | str | statement | ) |
Sets the sql statement to be executed by this handler.
statement | A string containing the SQL statement to be executed. |
This function is called automatically when Session.sql(sql) is called.
Parameter binding is supported and can be done by using the \b ? placeholder instead of passing values directly on the SQL statement.
Parameters are bound in positional order.
The actual execution of the SQL statement will occur when the execute() function is called.
After this function invocation, the following functions can be invoked:
SqlExecute bind | ( | Value | data | ) |
Registers a value or a list of values to be bound on the execution of the SQL statement.
data | the value or list of values to be bound. |
This method can be invoked any number of times, each time the received parameters will be added to an internal binding list.
This function can be invoked after:
After this function invocation, the following functions can be invoked:
std::shared_ptr< SqlResult > execute | ( | ) |
Executes the sql statement.
This function can be invoked after: