Data access with host variable arrays

A host variable array is a data array that is declared in a host language for use within an SQL statement. You can retrieve data into host variable arrays for use by your application program. You can also place data into host variable arrays to insert rows into a table.

You can specify host variable arrays in C, C++, COBOL, or PL/I. Each host variable array contains values for a column, and each element of the array corresponds to a value for a column. You must declare the array in the host program before you use it.

Begin general-use programming interface information.
Example: The following statement uses the main host variable array, COL1, and the corresponding indicator array, COL1IND. Assume that COL1 has 10 elements. The first element in the array corresponds to the first value, and so on. COL1IND must have at least 10 entries.
EXEC SQL
  SQL FETCH FIRST ROWSET FROM C1 FOR 5 ROWS
    INTO :COL1 :COL1IND               
END-EXEC.
End general-use programming interface information.