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:
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:
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.