where forward_direction can be empty or one of:

  1. LAST
  2. ABSOLUTE <count>
  3. RELATIVE <count>
  4. <count>
  5. ALL
  6. FORWARD
  7. 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.

It is not possible to move a cursor position backwards in Greenplum Database, since scrollable cursors are not supported. You can only move a cursor forward in position using MOVE.

Outputs

The count is the number of rows that a command with the same parameters would have returned (possibly zero).

forward_direction

The parameters for the MOVE command are identical to those of the FETCH command; refer to FETCH for details on syntax and usage.

cursor_name

The name of an open cursor.

Examples

– Start the transaction:

  1. BEGIN;

– Move forward 5 rows in the cursor mycursor:

  1. MOVE FORWARD 5 IN mycursor;
  2. MOVE 5

– Fetch the next row after that (row 6):

– Close the cursor and end the transaction:

  1. CLOSE mycursor;

There is no MOVE statement in the SQL standard.

See Also

DECLARE, , CLOSE

Parent topic: