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

NAME

       DECLARE -

SYNOPSIS

       DECLARE name [ BINARY ] [ INSENSITIVE ] [ [ NO ] SCROLL ]
           CURSOR [ { WITH | WITHOUT } HOLD ] FOR query
           [ FOR { READ ONLY | UPDATE [ OF column [, ...] ] } ]

DESCRIPTION

       DECLARE FETCH [fetch(7)]

         SELECT


          1  4-
         psql

              Note: :  "" FETCH   Bind

PARAMETERS

       name
               FETCH

       BINARY

       INSENSITIVE
                 PostgreSQL  SQL

       SCROLL

       NO SCROLL
              SCROLL   SCROLL  NO SCROLL

       WITH HOLD

       WITHOUT HOLD
              WITH HOLD  WITHOUT HOLD  WITHOUT HOLD WITH HOLD  WITH HOLD

       query
               SELECT  SELECT

       FOR READ ONLY

       FOR UPDATE
              FOR  READ  ONLY   FOR UPDATE   PostgreSQL   FOR UPDATE  FOR READ
              ONLY

       column
                PostgreSQL   FOR UPDATE

       BINARYINSENSITIVESCROLL

NOTES

         WITH HOLD Thus, DECLARE  without  WITH  HOLD  is  useless  outside  a
       transaction  block:  the cursor would survive only to the completion of
       the statement. Therefore PostgreSQL reports an error if this command is
       used outside a transaction block.  BEGIN [begin(7)], COMMIT [commit(7)]
       ROLLBACK [rollback(7)]

         WITH HOLD   WITH HOLD  CLOSE

         SCROLL   SQL  PostgreSQL  SCROLL    SCROLL   NO SCROLL

         SQL   SQL  ESQL   PostgreSQL   OPEN    PostgreSQL  SQL   ecpg   SQL92
       DECLAREOPEN

EXAMPLES


       DECLARE liahona CURSOR FOR SELECT * FROM films;

         FETCH [fetch(7)]

COMPATIBILITY

       SQL  SQL  PostgreSQL

       SQL   PostgreSQL

         PostgreSQL

       Postgresql  <laser@pgsqldb.org>