Data Type Classification | Data Types and Literals | Teradata Vantage - Data Type Classification - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zsn1556242031050.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantageā„¢

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
  • ARRAY/VARRAY
  • XML
  • JSON
  • DATASET