17.05 - CREATE GLOBAL TEMPORARY TRACE TABLE Syntax Elements - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Release Date
January 2021
Content Type
Programming Reference
Publication ID
B035-1144-175K
Language
English (United States)
database_name
user_name
Name of the database or user to contain table_name, if other than the current database or user.
table_name
Name of the global temporary trace table.
For information about naming database objects, see Teradata Vantage™ - SQL Fundamentals, B035-1141.
If the name is not fully qualified, then the system assigns it to the default database or user for the current session.
proc_ID BYTE(2)
Mandatory first column and data type for all global temporary trace tables.
This column records the number of the AMP on which the UDF that wrote the row is running.
The column can have any name, but it must be declared as BYTE(2).
sequence INTEGER
Mandatory second column and data type for all global temporary trace tables.
This column records a sequence number to indicate the order in which the function trace rows in the table were written for the logged AMP.
The column can have any name, but it must be declared as INTEGER.
column_name
Specifies the name of one or more optional columns, in the order in which they and their attributes are to be defined for the table. Up to 2,048 columns can be defined for a table.
For information about naming database objects, see Teradata Vantage™ - SQL Fundamentals, B035-1141.
data_type
data_type_attributes
One or more data definition phrases that define data for the column.
You must specify a single data type for each column_name.
You cannot specify a BLOB, CLOB, UDT, or Period type for any column in a global temporary trace table. You can dump all the predefined attributes of a UDT into a trace table using FNC calls, however (see Teradata Vantage™ - SQL External Routine Programming , B035-1147 for information about how to use FNC calls).
You cannot write Java strings into a global temporary trace table column defined with any of the following data types because the Java language does not support the types:
  • GRAPHIC
  • VARGRAPHIC
  • LONG GRAPHIC
Column data type attribute specifications are optional. If you specify attributes for a column, you should define its data type prior to defining the attributes.
The only valid constraints for global temporary trace table columns are NULL and NOT NULL.
If you specify NOT NULL, but the UDF does not return data, then that column is padded with appropriate values, depending on the data type.
You cannot specify DEFAULT or WITH DEFAULT column attributes for global temporary trace table columns.
If you do not specify explicit formatting, a column assumes the default format for the data type, which can be specified by a custom data formatting specification (SDF) defined by the tdlocaledef utility. See Teradata Vantage™ - Database Utilities , B035-1102 . Explicit formatting applies both to the parsing and to the retrieval of character strings.
You cannot define a temporal column for a global temporary trace table.
Data types and data type attributes are described in detail in Teradata Vantage™ - Data Types and Literals, B035-1143.
ON COMMIT
Action to perform when a transaction completes.
PRESERVE ROWS
Preserve the contents of a global temporary or volatile table when a transaction completes.
DELETE ROWS
Delete the contents of a global temporary or volatile table when a transaction completes.
DELETE is the default.