Values for curcmd

The curcmd field of the SRV_CURDESC structure can take one of the values described in Table 2-14. The table also lists the relevant cmdoptions values.

Table 2-14: Values for curcmd (SRV_CURDESC)

Value

Meaning

Legal values for cmdoptions

CS_CURSOR_CLOSE

Cursor close command.

SRV_CUR_DEALLOC or SRV_CUR_UNUSED. SRV_CUR_DEALLOC indicates that the cursor will never be reopened. The Open Server application should delete all associated cursor resources. The cursor ID number can be reused.

CS_CURSOR_DECLARE

Cursor declare command. The application can obtain the actual text of the cursor statement through srv_langlen and srv_langcpy.

SRV_CUR_UPDATABLE, SRV_CUR_RDONLY, or SRV_CUR_DYNAMIC. SRV_CUR_DYNAMIC indicates that the client declares 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.

CS_CURSOR_DELETE

Cursor delete command. Performs a positional row delete through a cursor.

There are no valid options for this command. cmdoptions will always have the value SRV_CUR_UNUSED.

CS_CURSOR_FETCH

Cursor fetch command. Performs a row fetch through a cursor.

There are no valid options for this command. cmdoptions will always have the value SRV_CUR_UNUSED.

CS_CURSOR_INFO

Cursor information command. The client sends this command to the Open Server application to set the cursor row fetch count or to request cursor status information. The Open Server application sends this command to the client in response to any cursor command (including CS_CURSOR_INFO itself) to describe the current cursor.

SRV_CUR_SETROWS when the client describes the current row fetch count. The fetchcnt field contains the requested fetch count. SRV_CUR_ASKSTATUS when the client requests status information about the current cursor. This generally occurs when the client has sent an attention and wants to see which cursors are still available afterwards. The curid field contains 0. The Open Server application should send back a CS_CURSOR_INFO response for each cursor currently available. SRV_CUR_INFORMSTATUS when the Open Server application responds to a CS_CURSOR_INFO command. The curstatus field contains the cursor status.

CS_CURSOR_OPEN

Cursor open command.

SRV_CUR_HASARGS or SRV_CUR_UNUSED.

CS_CURSOR_UPDATE

Cursor update command. Performs a positional row update through a cursor. The Open Server application can obtain the actual text of the cursor update statement by calling srv_langlen and srv_langcpy.

SRV_CUR_HASARGS or SRV_CUR_UNUSED.