CLOSE_ON_COMMIT

Specifies whether to close cursors not defined WITH HOLD or leave them open for further fetches after a COMMIT.

Syntax:

CLOSE_ON_COMMIT={YES | NO}

Parameters:

YES
Close cursors on COMMIT.
NO
Leave cursors open on COMMIT.

Properties:

Default: YES

Scope:

Used at compile time: Yes
Behavior at run time: Process

See Scope - OpenESQL SQL Compiler Directive Options for more information.

Comments:

By default, meaning CLOSE_ON_COMMIT is not specified or CLOSE_ON_COMMIT=YES is specified, all cursors not declared WITH HOLD are closed after a COMMIT.

CLOSE_ON_COMMIT works with the BEHAVIOR directive as follows:

BEHAVIOR=UNOPTIMIZED
CLOSE_ON_COMMIT is ignored. Cursor selection is least optimal. Cursor remains open after COMMIT.

Provides backward compatibility with Net Express.

BEHAVIOR=OPTIMIZED or ANSI, CLOSE_ON_COMMIT=YES (default)
Cursor selection is optimal. Cursor is closed after COMMIT.
BEHAVIOR=OPTIMIZED or ANSI, CLOSE_ON_COMMIT=NO
Cursor selection is optimal. Cursor remains open after COMMIT.