DEALLOCATE DESCRIPTOR statement

Use the DEALLOCATE DESCRIPTOR statement to free a previously allocated, system-descriptor area. Use this statement with Informix® ESQL/C.

Syntax

This statement is an extension to the ANSI/ISO standard for the SQL language.

DEALLOCATE DESCRIPTOR { 'descriptor' | descriptor_var }
Element Description Restrictions Syntax
descriptor Name of a system-descriptor area Use single quotation marks. System-descriptor area must already be allocated Quoted String
descriptor_var Host variable that contains the name of a system-descriptor area System-descriptor area must already be allocated, and the variable must already have been declared Name must conform to language-specific rules

Usage

The DEALLOCATE DESCRIPTOR statement frees all the memory that is associated with the system-descriptor area that descriptor or descriptor_var identifies. It also frees all the item descriptors (including memory for data items in the item descriptors).

You can reuse a descriptor or descriptor variable after it is deallocated. Otherwise, deallocation occurs automatically at the end of the program.

If you deallocate a nonexistent descriptor or descriptor variable, an error results.

You cannot use the DEALLOCATE DESCRIPTOR statement to deallocate an sqlda structure. You can use it only to free the memory that is allocated for a system-descriptor area.

The following examples show valid DEALLOCATE DESCRIPTOR statements. The first line uses an embedded-variable name, and the second line uses a quoted string to identify the allocated system-descriptor area.
EXEC SQL deallocate descriptor :descname;

EXEC SQL deallocate descriptor 'desc1';