Arrays of host variables

Informix® ESQL/C supports the declaration of arrays of host variables. You must provide an integer value as the size of the array when you declare the array. An array of host variables can be either one or two dimensional.

You can use elements of an array within Informix ESQL/C statements. For example, if you provide the following declaration:
EXEC SQL BEGIN DECLARE SECTION;
   long customer_nos[10];
EXEC SQL END DECLARE SECTION;
you can use the following syntax:
for (i=0; i<10; i++)
{
   EXEC SQL fetch customer_cursor into :customer_nos[i];
   
⋮

}

You can also use the array name alone within some SQL statements if the array is of type CHAR. For information about specific statements, see the Informix Guide to SQL: Syntax.