Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements > ALLOCATE COLLECTION >

Examples

The following example shows how to allocate resources with the ALLOCATE COLLECTION statement for the untyped collection variable, a_set:

EXEC SQL BEGIN DECLARE SECTION;
   client collection a_set;
EXEC SQL END DECLARE SECTION;
. . .
EXEC SQL allocate collection :a_set;

The following example uses ALLOCATE COLLECTION to allocate resources for a typed collection variable, a_typed_set:

EXEC SQL BEGIN DECLARE SECTION;
   client collection set(integer not null) a_typed_set;
EXEC SQL END DECLARE SECTION;
. . .
EXEC SQL allocate collection :a_typed_set;

Related Information

Related examples: Refer to the collection-variable example in PUT .

Related statements: ALLOCATE ROW and DEALLOCATE COLLECTION

For a discussion of collection data types in ESQL/C programs, see the IBM Informix ESQL/C Programmer's Manual.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]