3 PostgreSQL documentation
6 <refentry id=
"SQL-MOVE">
8 <refentrytitle id=
"SQL-MOVE-TITLE">MOVE
</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
14 <refname>MOVE
</refname>
15 <refpurpose>position a cursor
</refpurpose>
18 <indexterm zone=
"sql-move">
19 <primary>MOVE
</primary>
22 <indexterm zone=
"sql-move">
23 <primary>cursor
</primary>
24 <secondary>MOVE
</secondary>
29 MOVE [
<replaceable class=
"PARAMETER">direction
</replaceable> { FROM | IN } ]
<replaceable class=
"PARAMETER">cursorname
</replaceable>
34 <title>Description
</title>
37 <command>MOVE
</command> repositions a cursor without retrieving any data.
38 <command>MOVE
</command> works exactly like the
<command>FETCH
</command>
39 command, except it only positions the cursor and does not return rows.
43 The parameters for the
<command>MOVE
</command> command are identical to
44 those of the
<command>FETCH
</command> command; refer to
45 <xref linkend=
"sql-fetch" endterm=
"sql-fetch-title">
46 for details on syntax and usage.
51 <title>Outputs
</title>
54 On successful completion, a
<command>MOVE<
/> command returns a command
57 MOVE
<replaceable class=
"parameter">count
</replaceable>
59 The
<replaceable class=
"parameter">count
</replaceable> is the number
60 of rows that a
<command>FETCH
</command> command with the same parameters
61 would have returned (possibly zero).
66 <title>Examples
</title>
70 DECLARE liahona CURSOR FOR SELECT * FROM films;
72 -- Skip the first
5 rows:
73 MOVE FORWARD
5 IN liahona;
76 -- Fetch the
6th row from the cursor liahona:
78 code | title | did | date_prod | kind | len
79 -------+--------+-----+------------+--------+-------
80 P_303 |
48 Hrs |
103 |
1982-
10-
22 | Action |
01:
37
83 -- Close the cursor liahona and end the transaction:
90 <title>Compatibility
</title>
93 There is no
<command>MOVE
</command> statement in the SQL standard.
98 <title>See Also
</title>
100 <simplelist type=
"inline">
101 <member><xref linkend=
"sql-close" endterm=
"sql-close-title"></member>
102 <member><xref linkend=
"sql-declare" endterm=
"sql-declare-title"></member>
103 <member><xref linkend=
"sql-fetch" endterm=
"sql-fetch-title"></member>