Working with client-side cursors

A cursor is a record pointer in Adaptive Server. The cursor points to the first record in the file when a database file is selected and the cursor is opened. Using various commands, you can move the cursor forward, backward, to the top of the file, the bottom of file, and so on.

A client-side cursor is a cursor declared through Open Client calls or Embedded SQL. Open Client keeps track of the rows returned from Adaptive Server and buffers them for the application. Client-side cursors are similar to regular server-side cursors created with an explicit declare cursor command. Client-side cursors, however, are declared and controlled through special Open Client API calls in the client application, and Open Client itself manages portions of the cursor context information, whereas server-side cursors are managed only within Adaptive Server.Because OpenSwitch manages client-side cursors for the client application, it can restore the state of a given cursor during failover.

The default behavior of most Sybase ODBC drivers is to use client-side cursors rather than issuing direct SQL against the database. Sybase strongly recommends that you read this section carefully before deciding to use client-side cursors.