get scroll insensitive cursor

Creates a scrollable insensitive cursor with the name of the Identifier.

Syntax

GET SCROLL INSENSITIVE WITH NOHOLD
   CURSOR Identifier AS
   String
Note: SQLFire does not support holdable result sets.

Description

Creates a scrollable insensitive cursor with the name of the Identifier. The command issues a createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY) call and then executes the statement with a java.sql.StatementExecuteQuery request on the value of the String.

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 an error occurs in executing the statement, no cursor is created.

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

Scroll-insensitive result sets are not capable of scrolling. That means the cursor can move in only one direction. When the result set is open, any change to the database table will not reflect.

Unlike Scroll-insensitive, the Scroll-sensitive result set can move the cursor bidirectionally. It also enables the changes to the database tables when the result set is open. This is the default for sqlf scrollable cursor.

Once a scrollable cursor is created, use the following commands to work with the result set:

Example

sqlf(PEERCLIENT)> get with nohold cursor scrollCursor as 'select * 
from firsttable';

--another connection performs the following operations.
sqlf> select * from firsttable;
ID         |NAME
------------------------
40         |Forty
20         |TWENTY
30         |THIRTY
10         |TEN
50         |Fifty

5 rows selected
sqlf> update firsttable set name='FORTY' where id=40;
1 row inserted/updated/deleted

--the sensitive cursor reflects the update
sqlf(PEERCLIENT)> next scrollCursor;
ID         |NAME
------------------------
40         |FORTY

--scroll insensitive cursor
sqlf(PEERCLIENT)> get scroll insensitive with nohold cursor scrollCursor 
as 'select * from firsttable';

--another connection performs the following operation.
sqlf> update firsttable set name='Forty' where id=40;
1 row inserted/updated/deleted

--the insensitive cursor does not reflect the update
sqlf(PEERCLIENT)> next scrollCursor;
ID         |NAME
------------------------
40         |FORTY