#include <statement.h>
Public Methods | |
parameter & | bind (IN const char *name, IN OPTIONAL DataTypesEnum type=DT_UNKNOWN) |
Binds a named variable (parameter) to the statement. | |
void | execute (void) |
Executes a prepared SQL (or PL/SQL) statement. | |
resultset * | select (void) |
Executes a prepared SQL select statement and returns the resultset. | |
void | release (void) |
Releases resources allocated for a prepared SQL (or PL/SQL) statement. Cannot be reused. | |
parameter & | operator[] (IN const char *name) |
Access to bound variables by name. | |
parameter & | operator[] (IN ub2 parameter_index) |
Access to bound variables by index. | |
Friends | |
class | parameter |
class | connection |
statement class handles SQL or PL/SQL statements. In order a statement to be processed by the Oracle server following steps are executed: preparation, binding of named variables, execution (last step for DDL statements), description for select-list columns, definition of output variables and fetching of query results.
Steps necessary for execution of a DDL statement:
|
Binds a named variable (parameter) to the statement.
bind could be called after statement has been prepared (connection::prepare) and before statement is to be executed (statement::execute). No cleanup is necessary. Named variables (or parameters) are automatically cleaned-up when statement is released. |
|
Executes a prepared SQL (or PL/SQL) statement.
On success values of out parameters could be updated (depending on SQL statements). |
|
Executes a prepared SQL select statement and returns the resultset.
Could be used to execute a SQL select statement where conditions are controlled by using a named variable. resultset::release should be called when resultset is no longer needed. |
|
Access to bound variables by name.
|
|
Access to bound variables by index.
|