Provided by: manpages-zh_1.5.2-1_all bug

NAME

       FETCH -

SYNOPSIS

       FETCH [ direction { FROM | IN } ] cursorname

       where direction can be empty or one of:

           NEXT
           PRIOR
           FIRST
           LAST
           ABSOLUTE count
           RELATIVE count
           count
           ALL
           FORWARD
           FORWARD count
           FORWARD ALL
           BACKWARD
           BACKWARD count
           BACKWARD ALL

DESCRIPTION

       FETCH

         FETCH     FETCH   FETCH ALL  FETCH BACKWARD ALL

       NEXT, PRIOR, FIRST, LAST, ABSOLUTE, RELATIVE

       FORWARD  BACKWARD   count

       RELATIVE 0FORWARD 0 BACKWARD 0

PARAMETERS

       direction
              direction

              NEXT
                       direction

              PRIOR

              FIRST
                       ABSOLUTE 1

              LAST
                       ABSOLUTE -1

              ABSOLUTE count
                       count   count < 0 abs(count) count   ABSOLUTE 0

              RELATIVE count
                      count   count < 0   abs(count)  RELATIVE 0

              count
                       count   FORWARD count

              ALL
                       FORWARD ALL

              FORWARD
                       NEXT

              FORWARD count
                       count  FORWARD 0

              FORWARD ALL

              BACKWARD
                       PRIOR

              BACKWARD count
                       count  BACKWARD 0

              BACKWARD ALL

       count  count   FORWARD  BACKWARD  count   FORWARD  BACKWARD

       cursorname

OUTPUTS

         FETCH

       FETCH count

         count   psql   psql

NOTES

          FETCH  NEXT   FETCH   FETCH FORWARD SCROLL  PostgreSQL  SCROLL    NO
       SCROLL

       ABSOLUTE     FETCH ABSOLUTE 0

         PostgreSQL

       DECLARE [declare(7)] MOVE [move(7)]

EXAMPLES


       BEGIN WORK;

       --
       DECLARE liahona SCROLL CURSOR FOR SELECT * FROM films;

       --  5  liahona
       FETCH FORWARD 5 FROM liahona;

        code  |          title          | did | date_prod  |   kind   |  len
       -------+-------------------------+-----+------------+----------+-------
        BL101 | The Third Man           | 101 | 1949-12-23 | Drama    | 01:44
        BL102 | The African Queen       | 101 | 1951-08-11 | Romantic | 01:43
        JL201 | Une Femme est une Femme | 102 | 1961-03-12 | Romantic | 01:25
        P_301 | Vertigo                 | 103 | 1958-11-14 | Action   | 02:08
        P_302 | Becket                  | 103 | 1964-02-03 | Drama    | 02:28

       --
       FETCH PRIOR FROM liahona;

        code  |  title  | did | date_prod  |  kind  |  len
       -------+---------+-----+------------+--------+-------
        P_301 | Vertigo | 103 | 1958-11-14 | Action | 02:08

       --
       CLOSE liahona;
       COMMIT WORK;

COMPATIBILITY

       SQL  FETCH   FETCH  SELECT  FETCH  SQL

          FORWARD   BACKWARD   FETCH    FETCH  count    FETCH   ALL    FORWARD
       PostgreSQL

        SQL  FROM  IN

       Postgresql  <laser@pgsqldb.org>