1. Introduction : OpenAPI Concepts and Processes : Batch Statement Execution : How Batch Statements with Multiple Parameter Sets Are Repeated
 
Share this page                  
How Batch Statements with Multiple Parameter Sets Are Repeated
Certain statements such as insert statements, prepared statements, and database procedures, are likely to be executed multiple times in a batch with a different parameter set for each execution. Rather than calling IIapi_batch() with the same statement information for each parameter set, you can submit multiple parameter sets for a statement by calling IIapi_setDescriptor() and IIapi_putParms() for each parameter set after the call to IIapi_batch():
Each parameter set begins with a call to IIapi_setDescriptor() and ends when all parameter values have been provided with IIapi_putParms(). The statement is executed for each parameter set provided, and execution results are returned for each execution/parameter set. Providing a statement and n parameter sets is the same as providing the same statement n times, each with a single parameter set, except that the former may be optimized to reduce or eliminate redundant operations.
After the last parameter set is provided, you can submit the next batch statement by calling IIapi_batch() or retrieve the batch results by calling IIapi_getQueryInfo().
Note:  The database procedure name and, optionally, the procedure owner, are provided as service parameters in the parameter set. Even though these will be the same for each repeated execution of a database procedure, these service parameters must still be included with each parameter set.