base.SqlHandle.openScrollCursorWithHold
Opens the SQL handle with scrollable and holdable option.
Syntax
openScrollCursorWithHold()
Usage
Call the openScrollCursorWithHold() method to execute a prepared SQL statement,
and open the result set for use as a scrollable SQL 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.
After opening the scrollable cursor, use methods such as
fetchFirst(), fetchPrevious() and
fetchAbsolute(n) to move forwards and backwards in the SQL result set.
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.openScrollCursorWithHold()
BEGIN WORK
CALL sh.fetchFirst()
...
COMMIT WORK
CALL sh.fetchLast()