base.SqlHandle.fetchAbsolute
Fetches a specified row in a scrollable SQL result set.
Syntax
fetchAbsolute(position INTEGER)
- position is the absolute row position in the result set (starts at 1).
Usage
Call the fetchAbsolute()
method to fetch the specified row in a scrollable SQL
result set.
The SQL statement must have been opened with an openScrollCursor()
or
openScrollCursorWithHold()
.
After performing the fetch call, you can query for column information
with the getResultCount()
, getResultName(index)
, getResultType(index)
and getResultValue(index)
methods.
If the specified position does not correspond to a row position in the result set,
sqlca.sqlcode
is set to 100 (NOTFOUND
).
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.fetchAbsolute(10)
For a complete example, see Example 4: SqlHandle with scroll cursor.