1.1.1

Table Of Contents
Prepare()
Unlike other drivers, you can explicitly invoke Prepare() before adding any parameters. If this method is not
invoked explicitly and parameters are added, or if it has been invoked without any parameters, then it is invoked
implicitly before the rst execution of the command. If the CommandText of the command is changed, the
existing parameter list is cleared and prepare is invoked implicitly again before execution if the command has
parameters.
Two variations are provided to enable specication of parameters in the command string, either using wildcards
(positional parameters), or by explicitly specifying a name (named parameters). First option (positional parameters)
is to refer to the parameters using the wildcard "?" in which case the parameters are bound solely by their position
in the parameter list.
Batch operations using SQLFCommand
In addition to the capabilities provided by ADO.NET's DbCommand abstract class, this driver adds a feature to
enable execution of batch operations directly rather than with DataAdapters. The typical ow is to use the
AddBatch method to add new commands in the batch, then bind the required parameters and use an ExecuteBatch
at the end to get the results of each element of the batch. Note that select statements cannot be added in a batch.
Note: SQLFire does not support providing multiple SQL commands separated by semi-colons in a single
string. Users must either make use of the batching support as described in this section, or use DataAdapters
(VMware.Data.SQLFire.SQLFDataReader). In addition to passing multiple SQL commands as strings,
the batching support enables you to add multiple parameter lists for the same prepared command.
The batching operates in two modes:
Commands without any parameters
Prepared statements with parameters
In the case of command strings without any parameters, these can be added to the batch one by one, and their
results are returned by ExecuteBatch() as an array of integers, with each element being the update count of each
DML string in order.
In the case of statements with parameters, each batch is a new set of parameter values, and the command string
itself cannot be altered. The statement itself is prepared implicitly if it has not been prepared explicitly (by
invoking the Prepare method). The results returned by ExecuteBatch() are again an array of integers with each
element being the update count for command execution with the parameters at the respective position in the
batch.
The table describes API methods for batching.
DescriptionMethod
Enables binding a new set of parameters for the given statement with
parameters. The command is implicitly prepared if not prepared
AddBatch()
already. The new set of parameters are subsequently appended to the
batch in order and the result of ExecuteBatch() will have the update
count in the integer array result in that order. You cannot alter the
CommandText once this method is executed. If you attempt to do
so, the statement is implicitly closed and a new one created that loses
all current elements in the batch, if any. If the command takes no
parameters, each AddBatch execution essentially executes the same
command repeatedly. For an example of usage see the ExecuteBatch()
method.
Adds a new command text to the batch of execution. The command
string cannot have any parameters and cannot have been prepared
AddBatch(string)
691
ADO.NET Driver Reference