16.10 - Data Type Classification - Teradata Database

Teradata Database SQL Data Types and Literals

Teradata Database
June 2017
Programming Reference

Data types in Teradata can be classified as follows:

Predefined Data Types
System or predefined data types. A collection of traditional data types such as INTEGER, DECIMAL, FLOAT, VARCHAR, CHAR, BYTE, VARBYTE, and so forth. These are scalar data types.
ANSI User-defined Types (UDTs)
User-defined distinct and structured data types. The composition of these types and all associated functionality is defined by the user. The types can be developed in C or C++. Users can determine the following:
  • The data type or types that comprise the UDT using the CREATE TYPE statement.
  • The ordering and casting functionality by authoring the appropriate routines and using the CREATE CAST and CREATE ORDERING statements to form associations for the type.
  • The import and export behavior (transform behavior) by authoring the appropriate routines and using the CREATE TRANSFORM statement to form associations for the type.

Users can also create methods to augment the functionality associated with the UDT.

Complex Data Types (CDTs)
Data types provided by Teradata with some similarity in functionality to UDTs:
  • They are nonscalar. For most types, relational-style operations are not applicable.
  • They have their own individual literal forms.
  • They have formats for import and export that are defined by an ANSI standard, a formal specification, or is Teradata specified.
  • Teradata may include methods or functions that provide additional functionality for the data types.
The following are some CDTs provided by Teradata:
  • Period data types
  • Geospatial data types such as ST_Geometry, MBR, and MBB
  • XML
  • JSON