FOR Syntax Elements - Teradata Vantage - Analytics Database

SQL Stored Procedures and Embedded SQL

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2023-10-30
dita:mapPath
frc1628111662093.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
rjx1472253414573
lifecycle
latest
Product Category
Teradata Vantageā„¢
IF_statement
See IF.
CASE_statement
See CASE.
label_name
An optional label for the FOR statement.
If an ending-label is specified, you must specify a beginning-label that is equivalent to the ending-label. The beginning-label must be terminated by a colon character (:).
The label name of the BEGIN END compound statement cannot be reused in an iteration statement. One label name cannot be reused within one group of nested FOR statements, but can be reused for different non-nesting iteration statements.
for_loop_variable
The name of the loop.
cursor_name
The name of the cursor.
Used for updatable cursors as the object of the WHERE CURRENT OF clause.
cursor_specification
A single SELECT statement used as the cursor.
In read-only cursors, the single SELECT statement can contain one SELECT or multiple SELECTs that use set operators like UNION, INTERSECT or MINUS.
Updatable cursors do not support the set operators.
statement
One or more DML, DDL, DCL statements, including dynamic SQL statements, or control statements, including BEGIN END compound statements.