Process Access Id (Paid) Requirements; Cursor Position; Table 4-2. Determining The Cursor Position - HP NonStop SQL/MP Programming Manual

For c
Table of Contents

Advertisement

Data Retrieval and Modification

Process Access ID (PAID) Requirements

To use an SQL cursor, a process started by the program must have the access
authority shown in this table. NonStop SQL/MP checks this authority when the program
opens the cursor. For details, see
Access
SQL Objects
Read
Tables or protection views referred to in the SELECT statement associated with
the cursor (that is, specified in the DECLARE CURSOR statement)
Read
Tables or protection views underlying the shorthand view, if the cursor refers to a
shorthand view
Write
Tables referenced, if the cursor declaration includes the FOR UPDATE clause
A program can use a cursor whose declaration does not specify FOR UPDATE to
locate rows in a table to delete. NonStop SQL/MP tests the table only for read access
when the OPEN statement runs. However, because a DELETE operation requires
write access, NonStop SQL/MP checks for write access when you run the DELETE
statement.
A program contending for data access with other users can specify the IN EXCLUSIVE
MODE clause in the associated SELECT statement. NonStop SQL/MP then does not
have to convert the lock for a subsequent UPDATE or DELETE operation. However, if
a program is reading records accessed concurrently by a cursor defined with an IN
EXCLUSIVE MODE clause in another program, the first program must wait to access
the data.

Cursor Position

Table 4-2
describes the SQL statements that affect the cursor position in a program.
The cursor position is similar to the record position in a sequential file.

Table 4-2. Determining the Cursor Position

SQL Statement
OPEN
FETCH
DELETE
SELECT
CLOSE
HP NonStop SQL/MP Programming Manual for C—429847-008
Process Access ID (PAID) Requirements
Required Access Authority
Cursor Position or Action
Positions the cursor before the first row.
Positions the cursor at the retrieved row (or the current
position).
Positions the cursor between rows. For example, if the
current row is deleted, the cursor is positioned either
between rows or before the next row and after the
preceding row.
Determines the order in which the rows are returned. To
specify an order, include an ORDER BY clause.
Otherwise, the order is undefined.
Causes no position; release the result table established
by the cursor.
4-16
on page 7-1.

Advertisement

Table of Contents
loading

Table of Contents