assignment_statement - Analytics Database - Teradata Vantage

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
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.