Get Scroll Insensitive Cursor

Syntax

GET SCROLL INSENSITIVE [WITH {HOLD|NOHOLD}]
   CURSOR Identifier AS
   String

WITH HOLD is the default attribute of the cursor. For a non-holdable cursor, use the WITH NOHOLD option.

Note: WITH NOHOLD is only available in Java 2 Platform, Standard Edition, v 1.4 (J2SE) or higher.

Description

Creates a scroll insensitive cursor with the name of the Identifier. (It does this by issuing a createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY) call and then executing the statement with java.sql.StatementExecuteQuery request on the value of the String.)
Note: This command only works in a Java 2 Platform, Standard Edition, v 1.2 (J2SE) or higher environment.

Scroll insensitive cursors are not updatable.

If the String is a statement that does not generate a result set, the behavior of the underlying database determines whether an empty result set or an error is issued. If there is an error in executing the statement, no cursor is created.

ij sets the cursor name using a java.sql.Statement.setCursorName request. Behavior with respect to duplicate cursor names is controlled by the underlying database. Derby does not allow multiple open cursors with the same name.

Once a scrolling cursor has been created, you can use the follow commands to work with the result set:

Example

ij> autocommit off;
ij> get scroll insensitive cursor scrollCursor as
'SELECT * FROM menu FOR UPDATE OF price';
ij> absolute 5 scrollCursor;
COURSE    |ITEM                |PRICE
-----------------------------------------------
entree    |lamb chop           |14
ij> after last scrollcursor;
No current row
ij> before first scrollcursor;
No current row
ij> first scrollcursor;
COURSE    |ITEM                |PRICE
-----------------------------------------------
entree    |lamb chop           |14
ij> last scrollcursor;
COURSE    |ITEM                |PRICE
-----------------------------------------------
dessert   |creme brulee        |6
ij> previous scrollcursor;
COURSE    |ITEM                |PRICE
-----------------------------------------------
entree    |lamb chop           |14
ij> relative 1 scrollcursor;
COURSE    |ITEM                |PRICE
-----------------------------------------------
dessert   |creme brulee        |6
ij>>previous scrollcursor;
COURSE    |ITEM                |PRICE
-----------------------------------------------
dessert   |creme brulee        |6
ij> next scrollcursor;
COURSE    |ITEM                |PRICE
-----------------------------------------------
dessert   |creme brulee        |6
Related concepts
ij commands
ij errors
Related reference
Absolute
After Last
Async
Autocommit
Before First
Close
Commit
Connect
Disconnect
Driver
Elapsedtime
Execute
Exit
First
Get Cursor
Help
Last
LocalizedDisplay
MaximumDisplayWidth
Next
Prepare
Previous
Protocol
Readonly
Relative
Remove
Rollback
Run
Set Connection
Show Connections
Wait For
Comment
Identifier
String