15.10 - variable_name data_type - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

Teradata Database
Release Number
December 2015
Content Type
Programming Reference
Publication ID
English (United States)

[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.


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.


The literal must be compatible with the data type specified.

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


Default value for the variables.

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