Chapter 19: Cursors: Accessing Data

A cursor accesses the results of a SQL select statement one or more rows at a time. Cursors allow you to modify or delete individual rows or a group of rows.

Adaptive Server version 15.0 introduces scrollable, read-only cursors, which changes cursor functionality significantly from earlier releases. The scrollable cursor allows you to select one or several rows, and to scroll back and forth among them. Scrollable cursors are always read-only.

Using a nonscrollable cursor, you cannot go back to a row you have already selected, and you cannot move more than one row at a time.

Sybase continues to support the default, forward-only cursor, but recommends that you use the more convenient and flexible scrollable cursor whenever you do not need to update a result set through a cursor.

For detailed information on the global variables, commands, and functions that support cursors, see the Reference Manual: Building Blocks and the Reference Manual: Commands.