SafePrepared.setArgs

Bind a MySQLVal[] as the parameters of a prepared statement.

You can use this method to bind a set of variables in MySQLVal form to the parameters of a prepared statement.

Parameter specializations (ie, for chunked transfer) can be added if required. If you wish to use chunked transfer (via psn), note that you must supply a dummy value for val that's typed ubyte[]. For example: cast(ubyte[])[].

This method could be used to add records from a data entry form along the lines of

auto stmt = conn.prepare("INSERT INTO `table42` VALUES(?, ?, ?)");
DataRecord dr;    // Some data input facility
ulong ra;
do
{
    dr.get();
    stmt.setArgs(dr("Name"), dr("City"), dr("Whatever"));
    ulong rowsAffected = conn.exec(stmt);
} while(!dr.done);
More...
  1. void setArgs(T args)
  2. void setArgs(MySQLVal[] args, SafeParameterSpecialization[] psnList)
    struct SafePrepared

Parameters

args MySQLVal[]

External list of MySQLVal to be used as parameters

psnList SafeParameterSpecialization[]

Any required specializations

Detailed Description

Type Mappings

$(TYPE_MAPPINGS)

Meta