CURSORS in Teradata

The cursor is used to qualify the name of a column from a row in SPOOL. The cursor is automatically incremented until it has accessed the last row from SPOOL. It is impossible to access more than one row without using a cursor.

DECLARE CURSOR Statement:

The DECLARE CURSOR is used to establish a pointer into SPOOL to identify the next row to process.
The syntax for declaring a cursor is:
DECLARE <cursor name> [SCROLL | NO SCROLL]
CURSOR FOR <Multi row SQL statement> [FOR {Read only | update} ]


Example:
Declaring cursor for selecting rows from tbl_employee table
DECLARE cur_emp_select
CURSOR FOR
SELECT emp_name from tbl_employee;