Once a Client-Library cursor is declared, it is associated with only one command structure. Applications can obtain information about the cursor associated with a command structure by calling ct_cmd_props to retrieve the following properties:
CS_CUR_ID – contains the cursor’s server identification number. A cursor’s identification number can be retrieved after calling ct_cmd_props(CS_CUR_STATUS) to confirm that a cursor exists in a particular command space.
CS_CUR_NAME – contains the cursor’s name. An application can use the CS_CUR_NAME property to retrieve a cursor’s name any time after its ct_cursor(CS_CURSOR_DECLARE) call returns CS_SUCCEED.
CS_CUR_ROWCOUNT – contains the cursor-rows setting. This setting is the number of rows returned to Client-Library per internal fetch request. A cursor’s row count can be retrieved after calling ct_cmd_props(CS_CUR_STATUS) to confirm that a cursor exists in a particular command space.
CS_CUR_STATUS – indicates the cursor status. An application can use the CS_CUR_STATUS property to determine:
Whether a cursor exists within a command space
Whether the cursor is open
Whether the cursor can be used for updates
Whether the cursor is read-only, has sensitivity, and has scrollability.
Calling ct_cancel can cause a connection’s cursors to enter an undefined state. An application can use the cursor status property to determine how a cancel operation has affected a cursor.
CS_HAVE_CUROPEN – indicates whether the command structure has a cursor-open command that can be restored. See “Reopening a cursor”.
All of these properties are retrieve-only command structure properties whose values can be retrieved by calling ct_cmd_props. See the reference page for ct_cmd_props in the Open Client Client-Library/C Reference Manual.