move(7l)

move7l

Position a cursor on a specified row of a table

Usage

MOVE [ direction ] [ count ] 
    { IN | FROM } cursor

Overview

MOVE allows a user to move cursor position a specified number of rows. MOVE works like the FETCH command, but only positions the cursor and does not return rows.

Refer to FETCH [fetch(l)] for details on syntax and usage.

Notes

MOVE is a PostgreSQL language extension.

Refer to FETCH [fetch(l)] for a description of valid arguments. Refer to DECLARE [declare(l)] to define a cursor. Refer to BEGIN [begin(l)], COMMIT [commit(l)], and ROLLBACK [rollback(l)] 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
-- Fetch 6th row in the cursor liahona:
FETCH 1 IN liahona;
FETCH
 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

SQL92

There is no SQL92 MOVE statement. Instead, SQL92 allows one to FETCH rows from an absolute cursor position, implicitly moving the cursor to the correct position.

Releases

4 releases since Debian 2.0 (Hamm); the text changed 2 times.

  1. 2.0–2.1
  2. 2.2
  3. 3.0

From postgresql-client 7.2.1-2woody8 in Debian 3.0 (Woody). Parsed by carta from the page's man source.