NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
C-165
Cursor Position
have write authority for the referenced table, protection view, and underlying table of a
view. SQL checks authority to use a cursor when you execute an OPEN statement.
If you use a cursor to locate rows to delete without specifying FOR UPDATE in the
declaration, SQL checks only the read authority when the OPEN executes, even though
the delete requires write authority. SQL checks for write authority when the DELETE
executes. If your program is having problems contending for data access with other
users, you can specify the IN EXCLUSIVE MODE clause on the SELECT statement in
the cursor declaration so that SQL does not have to escalate the lock when an UPDATE
or DELETE executes. If, however, your program is reading records concurrently
accessed by a cursor defined with an IN EXCLUSIVE MODE clause, your program
must wait for access.
Cursor Position
Cursor position is similar to record position in a sequential file. Operations cause the
cursor to be positioned as follows:
Your SELECT determines the order in which rows are returned through a cursor. To
specify the order, include an ORDER BY clause; otherwise, the order is undefined.
Cursor Stability
Cursor stability guarantees that the row at the current position of the cursor cannot be
modified by another transaction. SQL does not guarantee cursor stability unless you
define the cursor with the FOR UPDATE clause or you specify the REPEATABLE
access option.
A cursor lacks stability if it points to a copy of the data and the data is concurrently
available to other applications. Unless you specify the FOR UPDATE clause, this can
happen when the SELECT that defines the cursor requires any of the following
operations:
Ordering the rows by a column
Removing duplicate rows
Performing other operations requiring that the table be copied into an interim result
table before use by your program
C89
The c89 command invokes components of the C compilation system from the OSS
environment. You can use it to perform any phase of a C compilation, including
OPEN Before the first row
FETCH On the retrieved row (the current position)
DELETE Between rows
UPDATE No change (the current position)
CLOSE No position