Download PostgreSQL User`s Guide - BITS

Transcript
Chapter 19. SQLCommands
FETCH
Name
FETCH Gets rows using a cursor
Synopsis
FETCH [ selector ] [ count ] { IN | FROM } cursor
FETCH [ RELATIVE ] [ { [ # | ALL | NEXT | PRIOR ] } ] FROM ] cursor
Inputs
selector
selector defines the fetch direction. It can be one the following:
FORWARD
fetch next row(s). This is the default if selector is omitted.
BACKWARD
fetch previous row(s).
RELATIVE
Noise word for SQL92 compatibility.
count
count determines how many rows to fetch. It can be one of the following:
#
A signed integer that specify how many rows to fetch. Note that a negative integer is
equivalent to changing the sense of FORWARD and BACKWARD.
ALL
Retrieve all remaining rows.
NEXT
Equivalent to specifying a count of 1.
PRIOR
Equivalent to specifying a count of -1.
226