15.10 - FOR - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K

Keyword introducing an iteration statement to repeat the execution of one or more statements for each row fetched by the cursor.

for_loop_variable
Name of the FOR loop.
See SQL Fundamentals, B035-1141 for the rules for naming database objects.
cursor_name
Name of the cursor.
The maximum length of a database object name is either 30 LATIN characters or 128 Unicode characters. For details about object name length limits, see SQL Fundamentals, B035-1141.
CURSOR FOR
Optional keywords qualifying the cursor_name as the cursor for the statement set to follow.
cursor_specification
The SELECT statement specifying the column names or expressions from which to fetch data rows in the CURSOR statement.
DO
Keyword introducing the sequence of statements to be performed in the CURSOR statement.
END FOR
Keywords ending the CURSOR statement.