DECLARE CURSOR statement 

The DECLARE CURSOR statement defines a named result table (see named/unnamed result table) with the name result table name .

Syntax

<declare cursor statement> ::= DECLARE <result table name> CURSOR FOR <select statement>

result table name, select statement

Explanation

An OPEN CURSOR statement with the name of the result table is required to actually generate the result table defined with a DECLARE CURSOR statement.

See also:

SELECT statement (select statement)