The CURSOR_COMMAND field of the CURSOR_DESC structure indicates the command to be processed. It can take one of the values described in Table 2-7. TDCURPRO can update this field with the next command to process for a given cursor. Table 2-7 also lists the relevant COMMAND_OPTIONS values.
CURSOR_COMMAND value |
Meaning |
Legal values for COMMAND_OPTIONS |
---|---|---|
TDS_CURSOR_CLOSE |
Cursor close command. |
TDS_CURSOR_DEALLOC or TDS_CURSOR_UNUSED. TDS_CURSOR_DEALLOC indicates that the cursor will never be reopened. The Open ServerConnect application should delete all associated cursor resources. The cursor ID number can be reused. |
TDS_CURSOR_DECLARE |
Cursor declare command. The application can obtain the actual text of the cursor statement through TDRCVSQL. |
TDS_CURSOR_UPDATABLE, TDS_CURSOR_RDONLY, or TDS_CURSOR_DYNAMIC. TDS_CURSOR_DYNAMIC indicates that the client is declaring the cursor against a dynamically prepared SQL statement. In this case, the text of the cursor statement is actually the name of the prepared statement. |
TDS_CURSOR_DELETE |
Cursor delete command. Performs a positional row delete through a cursor. |
There are no valid options for this command. COMMAND_OPTIONS always has the value TDS_CURSOR_UNUSED. |
TDS_CURSOR_FETCH |
Cursor fetch command. Performs a row fetch through a cursor. |
There are no valid options for this command. COMMAND_OPTIONS always has the value TDS_CURSOR_UNUSED. |
TDS_CURSOR_INFO |
Cursor information command. The client sends this command to the Open ServerConnect application to set the cursor row fetch count or to request cursor status information. The Open ServerConnect application sends this command to the client in response to any cursor command (including TDS_CURSOR_INFO itself) to describe the current cursor. |
TDS_CURSOR_SETROWS when the client is describing the current row fetch count. The FETCH_COUNT field contains the requested fetch count. TDS_CURSOR_ASKSTATUS when the client is requesting status information about the current cursor. This generally occurs when the client sends an attention and wants to see which cursors are still available afterwards. The CURSOR_ID field contains 0. The Open ServerConnect application should send back a TDS_CURSOR_INFO response for each cursor currently available. TDS_CURSOR_INFORMSTATUS when the Open ServerConnect application is responding to a TDS_CURSOR_INFO command. The CURSOR_STATUS field contains the cursor status. |
TDS_CURSOR_OPEN |
Cursor open command. |
TDS_CURSOR_HASARGS or TDS_CURSOR_UNUSED. |
TDS_CURSOR_UPDATE |
Cursor update command. Performs a positional row update through a cursor. The Open ServerConnect application can obtain the actual text of the cursor update statement by calling TDRCVSQL. |
TDS_CURSOR_UNUSED. |
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |