CursorType

Description

Supports the scrollable cursor feature introduced in Adaptive Server Enterprise 15.0, including directional scrolling (forwards and backwards) and sensitivity towards independent changes to table.

Applies to

Syntax

CursorType='value'

Parameter

Description

value

A string that specifies whether database cursors are scrollable and whether they are sensitive to modifications in data. Values are:

Default

CursorType='NonScrollable'

Usage

Adaptive Server Enterprise 15.0 allows both scrollable and nonscrollable cursors, which can be either semi-sensitive or insensitive. “Scrollable” means that you can scroll through the cursor result set by fetching any, or many, rows, rather than one row at a time; you can also scan the result set repeatedly. A scrollable cursor allows you to set the position of the cursor anywhere in the cursor result set for as long as the cursor is open.To use a scrollable cursor, you must use a DECLARE CursorName CURSOR SQL statement to declare it with a suitable SELECT statement and you must have the query engine provided in Adaptive Server 15.0 or later.

For sensitive scrolling to work correctly, the table must have a clustered index or a clustered unique constraint, such as a clustered primary key.

All scrollable cursors are read-only and can only be used when the value of the CursorUpdate database parameter is 0 (the default). If you need an updatable cursor, set the CursorUpdate parameter to 1. When CursorUpdate is set to 1, the value of CursorType is ignored. All update cursors are nonscrollable.

Both client and server must be Adaptive Server 15.0 or higher.

Examples

Example 1

To specify that database cursors support semi-sensitive scrolling (data modifications are presented when scrolling forwards), select Cursor Scrollable SemiSensitive from the Read Only Cursor Type drop-down list on the Transaction page in the Database Profile Setup dialog box.

See also

CursorUpdate