base.SqlHandle.openCursorWithHold

Opens the SQL handle with holdable option.

Syntax

openCursorWithHold()

Usage

Call the openCursorWithHold() method to execute the prepared SQL statement, and open the result set cursor with hold option, to keep the result set available across transaction boundaries.

The SQL statement must have been prepared with a prepare() call.

If the SQL statement contains ? parameter placeholders, use a setParameter() call for each parameter value. Values must be provided before opening the cursor.

As with standard Genero SQL instructions, SQL errors can be trapped with WHENEVER ERROR or TRY / CATCH blocks and by testing sqlca.sqlcode.

Example

DEFINE sh base.SqlHandle
...
CALL sh.openCursorWithHold()
BEGIN WORK
CALL sh.fetch()
...
COMMIT WORK
CALL sh.fetch()