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

SET AUTOFREE

Use the SET AUTOFREE statement to instruct the database server to enable or disable a memory-management feature that can free the memory allocated for a cursor automatically, as soon as the cursor is closed.

Only Dynamic Server supports this statement, which is an extension to the ANSI/ISO standard for SQL. You can use this statement only with ESQL/C.

Syntax

Read syntax diagramSkip visual syntax diagram                 .-ENABLED------.
>>-SET AUTOFREE--+-+----------+-+--+------------------------+--><
                   '-DISABLED-'    '-FOR--+-cursor_id-----+-'
                                          '-cursor_id_var-'
 

Element Description Restrictions Syntax
cursor_id Name of a cursor for which Autofree is to be reset Must already be declared within the program Identifier, p. Identifier
cursor_
_id_var
Host variable that holds the value of cursor_id Must store a cursor_id already declared in the program Must conform to language-specific rules for names.

Usage

When the Autofree feature is enabled for a cursor, and the cursor is subsequently closed, you do not need to explicitly use the FREE statement to release the memory that the database server allocated for the cursor. If you issue SET AUTOFREE but specify no option, the default is ENABLED.

The SET AUTOFREE statement that enables the Autofree feature must appear before the OPEN statement that opens a cursor. The SET AUTOFREE statement does not affect the memory allocated to a cursor that is already open. After a cursor is Autofree enabled, you cannot open that cursor a second time.

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