Only Dynamic Server supports this statement, which is an extension to the ANSI/ISO standard for SQL. Use this statement with ESQL/C.
>>-ALLOCATE COLLECTION--variable-------------------------------><
Element | Description | Restrictions | Syntax |
---|---|---|---|
variable | Name of the typed or untyped collection variable to allocate | Must be an unallocated ESQL/C collection-type host variable | Language-specific rules for names |
The ALLOCATE COLLECTION statement allocates memory for an ESQL/C variable that can store the value of a collection data type.
The ALLOCATE COLLECTION statement sets SQLCODE (that is, sqlca.sqlcode) to zero (0) if the memory allocation was successful and to a negative error code if the allocation failed.
You must explicitly release memory with the DEALLOCATE COLLECTION statement. After you free the collection variable with the DEALLOCATE COLLECTION statement, you can reuse the collection variable.