MOVE
SQL - Language Statements
MOVE
reposition a cursor
1999-07-20
MOVE [ direction { FROM | IN } ] cursor
1998-09-24
Description
MOVE repositions a cursor without retrieving any data.
MOVE works exactly like the FETCH
command, except it only repositions the cursor and does not return rows.
Refer to
for details on syntax and usage.
1998-09-24
Notes
The count returned in MOVE's status string is the
count of the number of rows that would have been returned by the
equivalent FETCH command.
Refer to
for a description of valid arguments.
Refer to
to define a cursor.
Refer to
,
,
and
for further information about transactions.
Usage
Set up and use a cursor:
BEGIN WORK;
DECLARE liahona CURSOR FOR SELECT * FROM films;
-- Skip first 5 rows:
MOVE FORWARD 5 IN liahona;
MOVE 5
-- Fetch 6th row in the cursor liahona:
FETCH 1 IN liahona;
code | title | did | date_prod | kind | len
-------+--------+-----+-----------+--------+-------
P_303 | 48 Hrs | 103 | 1982-10-22| Action | 01:37
(1 row)
-- close the cursor liahona and commit work:
CLOSE liahona;
COMMIT WORK;
Compatibility
1998-09-01
SQL92
There is no SQL92 MOVE statement.