Struct Command

(deprecated) Encapsulation of an SQL command or query.

struct Command ;

A Command be be either a one-off SQL query, or may use a prepared statement. 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.

Constructors

NameDescription
this Construct a naked Command object
this Construct a Command object complete with SQL

Properties

NameTypeDescription
lastInsertID[get] ulongAfter 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.
numParams[get] ushortGets the number of parameters in this Command
preparedFieldDescriptions[get] FieldDescription[]Gets the prepared header's field descriptions.
preparedParamDescriptions[get] ParamDescription[]Gets the prepared header's param descriptions.
resultFieldDescriptions[get] FieldDescription[]Gets the result header's field descriptions.
rowsPending[get] boolGets whether rows are pending
sql[get] const(char)[]Get the current SQL for the Command
sql[set] const(char)[]Set a new SQL command.

Methods

NameDescription
bindParameter Bind a D variable to a prepared statement parameter.
bindParameters Bind a Variant[] as the parameters of a prepared statement.
bindParameterTuple Bind a tuple of D variables to the parameters of a prepared statement.
execFunction Execute a stored function, with any required input variables, and store the return value into a D variable.
execPrepared Execute a prepared command.
execPreparedResult Execute a prepared SQL command for the case where you expect a result set, and want it all at once.
execPreparedSequence Execute a prepared SQL command for the case where you expect a result set, and want to deal with it one row at a time.
execPreparedTuple Execute a prepared SQL command to place result values into a set of D variables.
execProcedure Execute a stored procedure, with any required input variables.
execSQL Execute a one-off SQL command.
execSQLResult Execute a one-off SQL command for the case where you expect a result set, and want it all at once.
execSQLSequence Execute a one-off SQL command for the case where you expect a result set, and want to deal with it a row at a time.
execSQLTuple Execute a one-off SQL command to place result values into a set of D variables.
getArg Prepared statement parameter getter.
getNextRow Get the next Row of a pending result set.
param Access a prepared statement parameter for update.
prepare Submit an SQL command to the server to be compiled into a prepared statement.
purgeResult Flush any outstanding result set elements.
releaseStatement Release a prepared statement.
setNullParam Sets a prepared statement parameter to NULL.