3 .\" Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
6 .\" Manual: PostgreSQL 18.0 Documentation
7 .\" Source: PostgreSQL 18.0
10 .TH "MOVE" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 MOVE \- position a cursor
35 MOVE [ \fIdirection\fR ] [ FROM | IN ] \fIcursor_name\fR
37 where \fIdirection\fR can be one of:
57 repositions a cursor without retrieving any data\&.
59 works exactly like the
61 command, except it only positions the cursor and does not return rows\&.
63 The parameters for the
65 command are identical to those of the
69 for details on syntax and usage\&.
72 On successful completion, a
74 command returns a command tag of the form
88 is the number of rows that a
90 command with the same parameters would have returned (possibly zero)\&.
98 DECLARE liahona CURSOR FOR SELECT * FROM films;
100 \-\- Skip the first 5 rows:
101 MOVE FORWARD 5 IN liahona;
104 \-\- Fetch the 6th row from the cursor liahona:
105 FETCH 1 FROM liahona;
106 code | title | did | date_prod | kind | len
107 \-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-
108 P_303 | 48 Hrs | 103 | 1982\-10\-22 | Action | 01:37
111 \-\- Close the cursor liahona and end the transaction:
122 statement in the SQL standard\&.
124 \fBCLOSE\fR(7), \fBDECLARE\fR(7), \fBFETCH\fR(7)