15.10 - variable_name data_type - 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

[variable_name ]
[database_name | user_name ] table_name %ROWTYPE

Name and data type of the local variable being declared.

See SQL Fundamentals for the rules for naming database objects.

Any number of local variables of the same data type can be specified as a comma-separated list. These variable names are replaced by data values during execution.

Local variables can have UDT and %ROWTYPE data types.

The %ROWTYPE attribute dynamically creates an implicit data type based on the structure of a base table or global temporary table row in table_name. The table_name variable cannot refer to a volatile table.

DEFAULT

Optional keyword for introducing a default value for the local variables.

If more than one local variable is specified along with a default value, that value applies to all of the local variables in the list.

literal

The literal must be compatible with the data type specified.

You can only specify a literal or NULL, not an expression.

NULL

Default value for the variables.

A variable is initialized to NULL if no default value is specified.