15.00 - Data Type Codes - Teradata Database

Teradata Database Design

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

Data Type Codes

You should also maintain a list of UDTs and the codes you assign to them, staying as close to the existing code naming convention as possible.

The following table lists the valid predefined data types and their DBC.TVFields codes.

 

Data Type

Code

ARRAY (one‑dimensional)

VARRAY (one‑dimensional)

You cannot use any of the predefined UDT data types as the base type for creating a distinct UDT, so you cannot create a domain using a distinct UDT based on a one‑dimensional ARRAY/VARRAY type.

A1

ARRAY (multidimensional)

VARRAY (multidimensional)

You cannot use any of the predefined UDT data types as the base type for creating a distinct UDT, so you cannot create a domain using a distinct UDT based on a multidimensional ARRAY/VARRAY type.

AN

BINARY LARGE OBJECT (BLOB)

BL(n)

BIGINT

I8

BLOB

BO

BYTE

B(n)

BYTEINT

I1

CHARACTER

C(n)

CHARACTER VARYING

CV(n)
CV(n) is the same as VC(n)

CLOB

CO

CHARACTER LARGE OBJECT (CLOB)

CL(n)

DATE

D

DECIMAL

DEC (n[,m])

DOUBLE PRECISION

DP

FLOAT

F(n)

GRAPHIC

G(n)

INTEGER

I

INTERVAL YEAR

IY

INTERVAL YEAR TO MONTH

IYM

INTERVAL MONTH

IMO

INTERVAL DAY

ID

INTERVAL DAY TO HOUR

IDH

INTERVAL DAY TO MINUTE

IDM

INTERVAL DAY TO SECOND

IDS

INTERVAL HOUR

IH

INTERVAL HOUR TO MINUTE

IHM

INTERVAL HOUR TO SECOND

IHS

INTERVAL MINUTE

IMI

INTERVAL MINUTE TO SECOND

IMS

INTERVAL SECOND

IS

LONG CHARACTER VARYING

LVC

LONG GRAPHIC VARYING

LVG

NUMBER (both exact and approximate forms)

N

NUMERIC

NUM (n[,m])

PERIOD(DATE)

You cannot use any of the predefined Period data types as the base type for creating a distinct UDT, so you cannot create a domain using a distinct UDT based on a PERIOD type.

PD

PERIOD(TIME)

PT

PERIOD(TIME WITH TIME ZONE)

PTTZ

PERIOD(TIMESTAMP)

PTS

PERIOD(TIMESTAMP <UNTIL_CHANGED>)

When the ending element value for PERIOD(TIMESTAMP) is UNTIL_CHANGED, the stored value for the ending element is only 1 byte; otherwise it is 10 bytes.

PTS_UC

PERIOD(TIMESTAMP WITH TIME ZONE)

When the ending element value for PERIOD(TIMESTAMP) WITH TIME ZONE is UNTIL_CHANGED, the stored value for the ending element is only 1 byte; otherwise, it is 12 bytes.

PTSTZ

PERIOD(TIMESTAMP WITH TIME ZONE <UNTIL_CHANGED>)

PTSTZ_UC

PERIOD (with derived period columns)

PP

REAL

R

SMALLINT

I2

TIME

T

TIMESTAMP

TS

TIME WITH TIME ZONE

TTZ

TIMESTAMP WITH TIME ZONE

TSTZ

VARBYTE

VB(n)

VARCHAR

VC(n)
VC(n) is the same as CV(n)

VARCHAR(n) CHARACTER SET GRAPHIC

VG(n)

XML

XML

You should develop your own data type codes for the UDTs your site uses.

Example  

This example assumes you are using a single byte character set to define the Addr, City, and Comment domains.

 

Domains

Page: ___   of: ___

ELDM Page: ______

System: _________

Domain Name

Domain Description

Data Type

Max Bytes

Print Format

Constraint Number

Addr

Address

CV(30)

30

 

 

Amt

Dollar Amount

D(10,2)

8

$$$$$$$9.99

 

City

City Name

CV(30)

30

 

 

Comment

Comment

CV(100)

100