Rules for FOR-Loop Correlation Names - Advanced SQL Engine - Teradata Database

SQL Stored Procedures and Embedded SQL

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
vqj1592443206677.ditamap
dita:ditavalPath
vqj1592443206677.ditaval
dita:id
B035-1148
lifecycle
previous
Product Category
Teradata Vantageā„¢
  • A correlation name must be unique in a FOR iteration statement; however, the same correlation name can be used both for nested and non-nested FOR iteration statements.
  • A correlation name can be the same as the FOR loop variable and the names of cursors within a FOR iteration statement.
  • Columns and correlation names must be qualified with a FOR loop variable when referenced in SQL statements, including control statement, within the iteration statement.
  • If a column or correlation name is not qualified, then column and correlation name references are treated as either parameters or local variables.
  • The scope of a FOR iteration statement correlation name is the body of the statement.