Values for CURSOR-COMMAND and COMMAND-OPTIONS

The CURSOR-COMMAND field of the CURSOR-DESC structure indicates the command to be processed. It can take one of the values described in the following table. 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.

Table 2-7: Values for CURSOR-COMMAND and COMMAND-OPTIONS

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.