Product Documentation

V11.5 Update Guide

Previous Topic

Next Topic

DSQL partial support for scrollable cursors

New calls have been implemented in the DSQL API to set/get the scrollable cursor flag. When the scrollable cursor flag is turned on in the command handle, the cursor returned by the Execute function will be scrollable and the number of rows properly set to the rows in the resultset. This support has been implemented in the DSQL API to obtain the number of rows in the resultset.

ctsqlGetScrollableCursor

Retrieves the state of the scrollable cursor flag.

ctsqlSetScrollableCursor requires a valid command handle and needs to be called before the "prepare" call.

Note: Currently, the only reason to set scrollable cursors is to obtain the number of rows in the resultset immediately. At this time, there is no support to scroll through the resultset other than "next" (forward only).

Parameters:

  • [hCmd] - Must point to a valid command handle.

Return:

Returns CTSQL_TRUE if scrollable cursor flag is on.

ctsqlSetScrollableCursor

Added in c-treeACE V11.5, ctsqlSetScrollableCursor sets or clears the auto-commit flag. When the scrollable cursor flag is turned on in the command handle, the cursor returned by the Execute function will be scrollable and the number of rows properly set to the rows in the resultset. This support has been implemented to obtain the number of rows in the resultset.

Note: Currently, the only reason to set scrollable cursors is to obtain the number of rows in the resultset immediately. At this time, there is no support to scroll through the resultset other than "next" (forward only).

Parameters:

  • [hCmd] - Must point to a valid command handle
  • flag [IN] - Indicate if the scrollable cursor flag is to be turned on or off.

    CTSQL_TRUE indicates that the scrollable cursor flag is to be turned on, while CTSQL_FALSE indicates that the scrollable cursor flag is to be turned off.

Return:

Returns CTSQLRET_OK on success.

TOCIndex