MOVE
Positions a cursor.
Synopsis
MOVE [ <forward_direction> [ FROM | IN ] ] <cursor_name>
where <forward_direction>
can be empty or one of:
NEXT
FIRST
LAST
ABSOLUTE <count>
RELATIVE <count>
<count>
ALL
FORWARD
FORWARD <count>
FORWARD ALL
Description
MOVE
repositions a cursor without retrieving any data. MOVE
works exactly like the FETCH
command, except it only positions the cursor and does not return rows.
Note You cannot
MOVE
aPARALLEL RETRIEVE CURSOR
.
Note Because Cloudberry Database does not support scrollable cursors, it is not possible to move a cursor position backwards. You can only move a cursor forward in position using
MOVE
.
The parameters for the MOVE
command are identical to those of the FETCH
command; refer to FETCH
for details on syntax and usage.
Outputs
On successful completion, a MOVE
command returns a command tag of the form
MOVE <count>
The count is the number of rows that a FETCH
command with the same parameters would have returned (possibly zero).
Examples
Start the transaction:
BEGIN;
Create a cursor:
DECLARE mycursor CURSOR FOR SELECT * FROM films;