~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to doc/src/sgml/man7/MOVE.7

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'\" t
 
2
.\"     Title: MOVE
 
3
.\"    Author: The PostgreSQL Global Development Group
 
4
.\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
 
5
.\"      Date: 2011-04-27
 
6
.\"    Manual: PostgreSQL 9.1beta1 Documentation
 
7
.\"    Source: PostgreSQL 9.1beta1
 
8
.\"  Language: English
 
9
.\"
 
10
.TH "MOVE" "7" "2011-04-27" "PostgreSQL 9.1beta1" "PostgreSQL 9.1beta1 Documentation"
 
11
.\" -----------------------------------------------------------------
 
12
.\" * set default formatting
 
13
.\" -----------------------------------------------------------------
 
14
.\" disable hyphenation
 
15
.nh
 
16
.\" disable justification (adjust text to left margin only)
 
17
.ad l
 
18
.\" -----------------------------------------------------------------
 
19
.\" * MAIN CONTENT STARTS HERE *
 
20
.\" -----------------------------------------------------------------
 
21
.SH "NAME"
 
22
MOVE \- position a cursor
 
23
.\" MOVE
 
24
.\" cursor: MOVE
 
25
.SH "SYNOPSIS"
 
26
.sp
 
27
.nf
 
28
MOVE [ \fIdirection\fR [ FROM | IN ] ] \fIcursor_name\fR
 
29
 
 
30
where \fIdirection\fR can be empty or one of:
 
31
 
 
32
    NEXT
 
33
    PRIOR
 
34
    FIRST
 
35
    LAST
 
36
    ABSOLUTE \fIcount\fR
 
37
    RELATIVE \fIcount\fR
 
38
    \fIcount\fR
 
39
    ALL
 
40
    FORWARD
 
41
    FORWARD \fIcount\fR
 
42
    FORWARD ALL
 
43
    BACKWARD
 
44
    BACKWARD \fIcount\fR
 
45
    BACKWARD ALL
 
46
.fi
 
47
.SH "DESCRIPTION"
 
48
.PP
 
49
MOVE
 
50
repositions a cursor without retrieving any data\&.
 
51
MOVE
 
52
works exactly like the
 
53
FETCH
 
54
command, except it only positions the cursor and does not return rows\&.
 
55
.PP
 
56
The parameters for the
 
57
MOVE
 
58
command are identical to those of the
 
59
FETCH
 
60
command; refer to
 
61
\fBFETCH\fR(7)
 
62
for details on syntax and usage\&.
 
63
.SH "OUTPUTS"
 
64
.PP
 
65
On successful completion, a
 
66
MOVE
 
67
command returns a command tag of the form
 
68
.sp
 
69
.if n \{\
 
70
.RS 4
 
71
.\}
 
72
.nf
 
73
MOVE \fIcount\fR
 
74
.fi
 
75
.if n \{\
 
76
.RE
 
77
.\}
 
78
.sp
 
79
The
 
80
\fIcount\fR
 
81
is the number of rows that a
 
82
FETCH
 
83
command with the same parameters would have returned (possibly zero)\&.
 
84
.SH "EXAMPLES"
 
85
.sp
 
86
.if n \{\
 
87
.RS 4
 
88
.\}
 
89
.nf
 
90
BEGIN WORK;
 
91
DECLARE liahona CURSOR FOR SELECT * FROM films;
 
92
 
 
93
\-\- Skip the first 5 rows:
 
94
MOVE FORWARD 5 IN liahona;
 
95
MOVE 5
 
96
 
 
97
\-\- Fetch the 6th row from the cursor liahona:
 
98
FETCH 1 FROM liahona;
 
99
 code  | title  | did | date_prod  |  kind  |  len
 
100
\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-
 
101
 P_303 | 48 Hrs | 103 | 1982\-10\-22 | Action | 01:37
 
102
(1 row)
 
103
 
 
104
\-\- Close the cursor liahona and end the transaction:
 
105
CLOSE liahona;
 
106
COMMIT WORK;
 
107
.fi
 
108
.if n \{\
 
109
.RE
 
110
.\}
 
111
.SH "COMPATIBILITY"
 
112
.PP
 
113
There is no
 
114
MOVE
 
115
statement in the SQL standard\&.
 
116
.SH "SEE ALSO"
 
117
\fBCLOSE\fR(7), \fBDECLARE\fR(7), \fBFETCH\fR(7)