mysql-native v2.2.0
API Reference Home: [This Version] [Latest Version] [Other Versions]
Struct Prepared
Encapsulation of a prepared statement.
struct Prepared
;
Create this via the function prepare. Set your arguments (if any) via
the functions provided, and then run the statement by passing it to
exec/query/etc in place of the sql string parameter.
Commands that are expected to return a result set - queries - have distinctive
methods that are enforced. That is it will be an error to call such a method
with an SQL command that does not produce a result set. So for commands like
SELECT, use the query functions. For other commands, like
INSERT/UPDATE/CREATE/etc, use exec.
Constructors
| Name | Description |
|---|---|
this
|
Constructor. You probably want prepare instead of this.
|
Properties
| Name | Type | Description |
|---|---|---|
columnSpecials[get, set]
|
ColumnSpecialization[] | Get/set the column specializations. |
lastInsertID[get]
|
ulong | After a command that inserted a row into a table with an auto-increment ID column, this method allows you to retrieve the last insert ID generated from this prepared statement. |
numArgs[get]
|
ushort | Gets the number of arguments this prepared statement expects to be passed in. |
preparedFieldDescriptions[get]
|
FieldDescription[] | Gets the prepared header's field descriptions. |
preparedParamDescriptions[get]
|
ParamDescription[] | Gets the prepared header's param descriptions. |
Methods
| Name | Description |
|---|---|
getArg
|
Prepared statement parameter getter. |
setArg
|
Prepared statement parameter setter. |
setArgs
|
Bind a tuple of D variables to the parameters of a prepared statement. |
setArgs
|
Bind a Variant[] as the parameters of a prepared statement. |
setNullArg
|
Sets a prepared statement parameter to NULL. |
sql
|
Gets the SQL command for this prepared statement. |