13.6.6.2 Cursor DECLARE Syntax

DECLARE cursor_name CURSOR FOR select_statement

This statement declares a cursor and associates it with a
SELECT statement that retrieves
the rows to be traversed by the cursor. To fetch the rows later,
use a FETCH statement. The number
of columns retrieved by the
SELECT statement must match the
number of output variables specified in the
FETCH statement.