15.00 - Teradata Database Data Types - Teradata Database

Teradata Database Design

prodname
Teradata Database
vrm_release
15.00
category
User Guide
featnum
B035-1094-015K

Teradata Database Data Types

When you applications require a strict domain type to ensure domain integrity, particularly for column comparisons and arithmetic operations, you should consider defining user‑defined distinct data types for those domains.

See SQL Data Definition Language for information about creating user‑defined data types and their associated database objects.

See SQL External Routine Programming for information about writing external code for the methods you define to work with user‑defined types.

The following table lists the valid Teradata Database predefined data types you can use to define a domain or to create new user‑defined data types:

 

Data Type

Definition

ARRAY
VARRAY

Not valid.

You cannot create a distinct UDT using a ARRAY/VARRAY data types, so you cannot create a domain using an ARRAY/VARRAY predefined type as its base.

BLOB
BYTE
VARBYTE

A binary integer used to store digital images.

BINARY LARGE OBJECT (BLOB)

A large binary string used to store binary objects such as musical recordings, videos, and other multimedia.

CLOB
CHARACTER
VARCHAR
LONG VARCHAR
GRAPHIC

Any glyph from a supported language.

For the English language, this type is often referred to as alphanumeric.

The CLOB type is typically used to define large character objects whose length exceeds 64KB.

CHARACTER LARGE OBJECT (CLOB)

A large character string used to store documents, possibly encoded using tag languages such as XML.

XML

A large binary string used to store XML documents in XML format.

DATE

A valid, named 24-hour epoch from the Gregorian calendar.

DECIMAL

Any base-10 real number, including those with a fractional part.

NUMBER (Exact form)

Any base‑10 real number, including those with a fractional part.

FLOAT
REAL
DOUBLE PRECISION

A rational number expressed in exponential format which, depending on the value, might be exact or might be an approximation to a real number.

NUMBER (Approximate form)

Any base‑10 rational number expressed in exponential format.

BIGINT
INTEGER
BYTEINT
SMALLINT

Any natural number.

INTERVAL

A time duration with optional fractional precision. Interval data is not implemented atomically, though it is generally treated logically as if it were atomic.

TIME

A valid time expressed using 24-hour notation with optional fractional precision.

The TIME type can also be defined with a TIME ZONE.

TIMESTAMP

A valid date and time expressed using 24-hour notation with optional fractional precision.

The TIMESTAMP type can also be defined with a TIME ZONE.

Period

Not valid.

You cannot create a distinct UDT using the Period data type, so you cannot create a domain using the Period predefined type as its base.

See SQL Data Types and Literals for complete listings and descriptions of the data types available for Teradata Database table columns.

You can also use these predefined data types to create your own user‑defined data types that may be more suitable for your particular application workloads. See SQL Data Definition Language and SQL External Routine Programming for details.