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:

1> use pubs2
2> go
1> declare CI insensitive scroll cursor for
2> select au_lname, au_id from authors
3> go
1> set showplan on
2> go
1> open CI
2> go

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).

2 operator(s) under root

The type of query is DECLARE CURSOR.

ROOT:EMIT Operator

	|SCROLL Operator (Sensitive Type: Insensitive)
	|     Using Worktable1 for internal storage.
	|
	|   |SCAN Operator
	|   |  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. The scroll operator message specifies that the CI cursor is insensitive.

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