CursorType database parameter
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.
Controls
-
ASE, SYC SAP Adaptive
Server Enterprise (15.0 and later)
Syntax
1 |
CursorType='<span>value</span>' |
Parameter |
Description |
---|---|
value |
A string that specifies whether database
|
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, such as the PowerBuilder
Dynamic SQL Format 3 and Dynamic SQL Format 4 statements, 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.
If a scrollable cursor is moved to a position before the first
row or after the last row, SQLCA.SQLCode
returns
100 and no data is returned. However, users can continue to fetch
data by using a suitable FETCH statement after
receiving this SQLCode value.
Both client and server must be Adaptive Server 15.0 or higher.
Examples
To specify support for semi-sensitive scrollable
cursors (data modifications are presented when scrolling forwards):
-
Database profile
Select Cursor Scrollable SemiSensitive from the Read Only
Cursor Type drop-down list on the Transaction page in the Database Profile
Setup dialog box. -
Application
Type the following in code:
1SQLCA.DbParameter="CursorType='ScrollSemiSensitive'"