DB2 Version 9.7 for Linux, UNIX, and Windows

ArrayInputChain CLI/ODBC configuration keyword

Enables array input without needing pre-specified size and memory allocation requirements of normal array input.

db2cli.ini keyword syntax:
ArrayInputChain = -1 | 0 | <positive integer>
Default setting:
Normal input array is enabled, where the array and its size must be specified before the corresponding SQLExecute() call is made.
Usage notes:
 

By default, array input (where an array of values is bound to an input parameter) requires the array and its size to be specified before the corresponding SQLExecute() function is called. An application, however, may not know the array size in advance, or the array size may be too large for the application to allocate from its pool of available memory. Under these circumstances, the application can set ArrayInputChain=-1 and use the SQL_ATTR_CHAINING_BEGIN and SQL_ATTR_CHAINING_END statement attributes to enable chaining, which allows array input without the pre-specified size and memory requirements of normal array input.

To enable chaining:
  1. Set the keyword ArrayInputChain = -1.
  2. Prepare and bind input parameters to the SQL statement.
  3. Set the SQL_ATTR_CHAINING_BEGIN statement attribute with SQLSetStmtAttr().
  4. Update the bound parameters with input data and call SQLExecute().
  5. Repeat Step 4 for as many rows as there are in the input array.
  6. Set the SQL_ATTR_CHAINING_END statement attribute with SQLSetStmtAttr() after the last row in the array has been processed according to Step 4.
The effect of completing these steps will be the same as if normal array input had been used.

Setting ArrayInputChain=0 (the default value) turns this array input feature off. ArrayInputChain can also be set to any positive integer which sets the array size to use for the input array.

Restriction: DB2® CLI does not support array input chaining for compound SQL (compiled) or compound SQL (inlined) statements.