SCROLL operator

The SCROLL operator encapsulates the functionality of scrollable cursors in Adaptive Server. Scrollable cursors may be insensitive, meaning that they display a snapshot of their associated data, taken when the cursor is opened, or semi-sensitive, meaning that the next rows to be fetched are retrieved from the live data.

The SCROLL operator is a unary operator that displays this message:

SCROLL OPERATOR ( Sensitive Type: <T>)

The type may be insensitive or semi-sensitive.

This is an example of a plan featuring an insensitive scrollable cursor:

declare CI insensitive scroll cursor for
select au_lname, au_id from authors
go
set showplan on
go
open CI

QUERY PLAN FOR STATEMENT 1 (at line 1).

STEP 1
The type of query is OPEN CURSOR CI.


QUERY PLAN FOR STATEMENT 1 (at line 2).

STEP 1
The type of query is DECLARE CURSOR.

2 operator(s) under root

ROOT:EMIT Operator (VA = 2)

   |SCROLL Operator (Sensitive Type: Insensitive) (VA = 1)
   | Using Worktable1 for internal storage.
   |
   |   |SCAN Operator (VA = 0)
   |   | FROM TABLE
   |   | authors
   |   | Table Scan.
   |   | Forward Scan.
   |   | Positioning at start of table.
   |   | Using I/O Size 4 Kbytes for data pages.
   |   | With LRU Buffer Replacement Strategy for data pages.

The SCROLL operator is the child operator of the root EMIT operator, and its only child is the SCAN operator on the authors table. SCROLL message specifies that the CI cursor is insensitive.

Scrollable cursor rows are initially cached in memory. Worktable1 is used as a backing store for this cache when the amount of data processed exceeds the cache’s physical memory limits.