Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Examples [Table of Contents] See also

Open Client Client-Library/C Reference Manual

[-] Chapter 3 Routines
[-] ct_cursor
[-] Usage

Usage

Summary of ct_cursor parameters

Value of type

Command initiated

name value

text value

option value

CS_CURSOR_ DECLARE

A cursor declare command.

A pointer to the cursor name.

A pointer to the SQL text that is the body of the cursor.

CS_UNUSED, or a bitwise OR of the values in Table 3-15.

CS_CURSOR_ OPTION

A cursor set options command.

NULL

NULL

  • CS_FOR_UPDATE to indicate that the cursor is "for update."

  • CS_READ_ONLY to indicate that the cursor is "read-only."

  • CS_UNUSED to indicate that the server should decide whether a cursor is updatable.

See Specifying updatability on page 373 for more information.

CS_CURSOR_ROWS

A cursor set rows command.

NULL

NULL

An integer representing the number of rows to be returned with a single fetch request.

CS_CURSOR_OPEN

A cursor open command.

NULL

NULL

  • CS_RESTORE_OPEN restores parameter-binding information for a previously sent cursor-open command. See "Restoring a cursor-open command" for an explanation.

  • CS_UNUSED should be passed the first time a cursor is opened.

CS_CURSOR_ UPDATE

A cursor update command.

A pointer to the name of the table to update.

A pointer to the SQL update statement.

  • CS_UNUSED if *text is the entire update statement.

  • CS_MORE if *text is part of the update statement.

  • CS_END if *text is the last piece of the update statement.

CS_CURSOR_ DELETE

A cursor delete command.

A pointer to the name of the table to delete from.

NULL

CS_UNUSED

CS_CURSOR_ CLOSE

A cursor close command.

NULL

NULL

  • CS_DEALLOC to close and deallocate the cursor.

  • CS_UNUSED to close the cursor without deallocating it.

CS_CURSOR_ DEALLOC

A deallocate cursor command.

NULL

NULL

CS_UNUSED

CS_IMPLICIT_CURSOR

  • cursor is marked read only.

  • new rows inserted after last row fetch are not seen by subsequent fetches.

Sequencing cursor commands

Cursor-declare commands

Option values for ct_cursor(CS_ CURSOR_DECLARE)

Specifying updatability

Dynamic SQL cursor option

Cursor-Rows commands

Cursor-open commands

Batching cursor-open commands

Restoring a cursor-open command

Cursor-update commands

Cursor-delete commands

Cursor-close commands

A nested cursor-close command is the preferred way to abandon rows returned from a cursor-open command, since ct_cancel can put a connection's cursors into an undefined state.

Cursor-deallocate commands


Examples [Table of Contents] See also