assignment_statement - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

The SET statement.

See Teradata Vantage™ - SQL Stored Procedures and Embedded SQL , B035-1148 for details.

You can specify these options for assignment statements.

SET
A keyword introducing the SET statement used for assigning a value to a variable or parameter.
You can assign a UDT expression to a UDT variable or parameter; however, the mutator SET clause syntax (see UPDATE in Teradata Vantage™ - SQL Data Manipulation Language, B035-1146 for details about mutator SET clause syntax) is not supported within a SET statement. The workaround for this is to use the standard non-mutator SET clause format, with the column reference on one side of the equal sign and a UDT expression containing the appropriate mutators on the other side.
assignment_target
Name of the variable or parameter to be assigned a value.
If you are assigning to a parameter, it cannot be an IN parameter.
If you are assigning to any variable, it cannot be named QUERY_BAND.
You cannot set values for status variables in SQL procedures.
assignment_source
Arithmetic and string expressions that contain the value to be assigned to a variable.
SQL procedure local variables, status variables, IN or INOUT parameters, and FOR loop column and correlation names can be specified in the assignment_source, which is also known as a value expression.