Skip to content

MOVE cursor

Change the position of a cursor without returning any rows.

MOVE [ direction [ FROM | IN ] ] name

where direction is one of the options defined in the description of FETCH, and name is an open cursor.

For example:

premdb=# begin;
BEGIN
premdb=# declare team cursor for select * from team order by teamid;
DECLARE CURSOR
premdb=# move team;
MOVE 1
premdb=# move forward 10 in team;
MOVE 10
premdb=# fetch next from team;
 teamid | htid | atid |       name        | nickname |  city  |  stadium   | capacity 
--------+------+------+-------------------+----------+--------+------------+----------
    12 |   13 |   62 | Charlton Athletic | Addicks  | London | The Valley |    27111
(1 row)

See also FETCH.

Parent topic:SQL Commands