Fields in a CURSOR-DESC structure

Table 2-5 describes each field in a CURSOR-DESC structure.

Table 2-5: Fields in a CURSOR-DESC structure

Field name

Description

Notes

CURSOR-ID

The current cursor identifier.

The Open ServerConnect application must set CURSOR-ID when responding to a TDS-CURSOR-DECLARE (DECLARE CURSOR) command from the client. This happens when the client sends a DECLARE CURSOR command that has CURSOR-NAME as a required parameter.

The Gateway-Library transaction receives the DECLARE CURSOR command from the client, calls TDCURPRO to specify a unique cursor identifier in the CURSOR-ID field, and returns the unique cursor ID to the client.

The client uses the unique cursor ID (instead of the initial cursor name) in the CURSOR-ID field of the CURSOR-DESC structure for all subsequent commands regarding this cursor.

NUMBER-OF- UPDATE- COLUMNS

The number of columns in a cursor update clause.

NUMBER-OF-UPDATE-COLUMNS is set to 0 if there are no update columns. This information is available at declare time.

FETCH-COUNT

The current row fetch count for this cursor (the number of rows that are sent to the client in response to a TDS-CURSOR-FETCH command).

FETCH-COUNT is described when a TDS-CURSOR-INFO command is received from the client, or sent to the client in response to such a command. FETCH-COUNT is set to 1 if the client has not explicitly set a row fetch count. If the Open ServerConnect application cannot support the requested fetch count, it can set this field to a different value before responding.

CURSOR-STATUS

The status of the current cursor.

Open ServerConnect sets the cursor status in response to the cursor command received from the client. See Table 2-6 for a list of legal values.

CURSOR- COMMAND

The current cursor command type.

See Table 2-7 for a list of legal values.

COMMAND-OPTIONS

Any options associated with the cursor command.

Not all commands have associated options. The value of COMMAND-OPTIONS depends on the cursor command. Table 2-7 describes the possible values for COMMAND-OPTIONS.

FETCH-TYPE

The type of fetch requested by a client.

FETCH-TYPE is described when a TDS-CURSOR-FETCH command is received from the client. The valid fetch types and their meanings are as follows: - TDS-NEXT – next row - TDS-PREV – previous row - TDS-FIRST – first row - TDS-LAST – last row - TDS-ABSOLUTE – row identified in the ROW-OFFSET field - TDS-RELATIVE – current row plus or minus the value in the ROW-OFFSET field Requests to Open ServerConnect always have a FETCH-TYPE of TDS-NEXT.

ROW-OFFSET

The row position for TDS-ABSOLUTE or TDS-RELATIVE fetches.

ROW-OFFSET is undefined for all other fetch types. ROW-OFFSET is described when a TDS-CURSOR-FETCH command is received from the client.

CURSOR-NAME- LENGTH

The length of the cursor name in CURSOR-NAME.

CURSOR-NAME-LENGTH is zero if not used. If used, CURSOR-NAME-LENGTH is the actual length.

CURSOR-NAME

The name of the current cursor.

TABLE-NAME- LENGTH

The length of the table name in TABLE-NAME.

TABLE-NAME-LENGTH is zero if not used. If used, TABLE-NAME-LENGTH is the actual length. TABLE-NAME-LENGTH is described when a TDS-CURSOR-UPDATE or TDS-CURSOR-DELETE command is received from the client.

TABLE-NAME

The table name associated with a cursor update or delete command.

TABLE-NAME is described when a TDS-CURSOR-UPDATE or TDS-CURSOR-DELETE command is received from the client.