informix
Informix Guide to SQL: Syntax
SQL Statements

DEALLOCATE ROW

Use the DEALLOCATE ROW statement to release memory for a row variable that was previously allocated with the ALLOCATE ROW statement.

Use this statement with ESQL/C.

Syntax

Element Purpose Restrictions Syntax
variable Name that identifies a typed or untyped row variable for which to deallocate memory The variable must be an ESQL/C row variable that has already been allocated. Name must conform to language-specific rules for variable names.

Usage

The DEALLOCATE ROW statement frees all the memory that is associated with the ESQL/C row variable that variable identifies. You must explicitly release memory resources for a row variable with DEALLOCATE ROW. Otherwise, deallocation occurs automatically at the end of the program.

The DEALLOCATE COLLECTION statement releases resources for both typed and untyped row variables.

Tip: The DEALLOCATE ROW statement deallocates memory for an ESQL/C row variable only. To deallocate memory for an ESQL/C collection variable, use the DEALLOCATE COLLECTION statement.

If you deallocate a nonexistent row variable or a variable that is not an ESQL/C row variable, an error results. Once you deallocate a row variable, you can use the ALLOCATE ROW statement to reallocate resources, and you can then reuse a row variable.

Example

The following example shows how to deallocate resources for the row variable, a_row, with the DEALLOCATE ROW statement:

Related Information

Related statements: ALLOCATE ROW and DEALLOCATE COLLECTION

For a discussion of row types, see the Informix Guide to SQL: Tutorial.

For a discussion of complex data types, see the Informix ESQL/C Programmer's Manual.


Informix Guide to SQL: Syntax, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved