Progress
SQL-89
Guide and Reference


DECLARE CURSOR Statement

Associates a cursor name with a SELECT statement.

SYNTAX
DECLARE cursor-name CURSOR FOR
  { SELECT-statement | UNION-statement }
  [ FOR { READ [ ONLY ] | UPDATE } ] 

cursor-name

Identifies the name of the cursor.

NOTE

CURSOR-FOR {SELECT-statement | UNION-statement}

SELECT-statement specifies a retrieval set of rows that is accessible when you open the cursor. For more information, see the SELECT Statement reference entry.

UNION-statement specifies a retrieval set of rows that is accessible when you open the cursor. For more information, see the reference entry for the UNION statement.

FOR READ [ ONLY ]

Specifies that you cannot modify the rows retrieved for the cursor.

FOR UPDATE

Specifies that you can modify the rows retrieved for the cursor. You cannot use FOR UPDATE if you associate the cursor with a UNION statement.

EXAMPLE

This example associates the c01 cursor with a SELECT statement.

DECLARE c01 CURSOR FOR SELECT * FROM Customer
  WHERE Cust-Num < 5. 

NOTE

SEE ALSO

CLOSE Statement, DELETE FROM Statement, FETCH Statement, OPEN Statement, UPDATE Statement


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095