Thursday, August 09, 2012

Teradata Datatypes

This chart indicates which data types that Teradata currently supports as ANSI Standards:

Data Type
Description
Data Value Range
INTEGER
Signed whole number
-2,147,483,648 to 2,147,483,647
SMALLINT
Signed smaller whole number
-32,768 to 32,767
DECIMAL(X,Y)
Where: X=1 thru 18, total number of digits in the number
And Y=0 thru 18 digits to the right of the decimal
Signed decimal number
18 digits on either side of the decimal point
Largest value DEC(18,0)
Smallest value DEC(18,18)
NUMERIC(X,Y)
Same as DECIMAL
Synonym for DECIMAL
Same as DECIMAL
FLOAT
Floating Point Format (IEEE)
<value>x10307 to <value>x10-308
REAL
Stored internally as FLOAT

PRECISION
Stored internally as FLOAT

DOUBLE PRECISION
Stored internally as FLOAT

CHARACTER(X)
CHAR(X)
Where: X=1 thru 64000
Fixed length character string, 1 byte of storage per character,
1 to 64,000 characters long, pads to length with space
VARCHAR(X) CHARACTER VARYING(X)
CHAR VARYING(X)
Where: X=1 thru 64000
Variable length character string, 1 byte of storage per character, plus 2 bytes to record length of actual data
1 to 64,000 characters as a maximum. The system only stores the characters presented to it.
DATE
Signed internal representation of YYYMMDD (YYY represents the number of years from 1900, i.e. 100 for Year 2000)
Currently to the year 3500 as a positive number and back into AD years as a negative number.
TIME
Identifies a field as a TIME value with Hour, Minutes and Seconds

TIMESTAMP
Identifies a field as a TIMESTAMP value with Year, Month, Day, Hour, Minute, and Seconds


This chart indicates which data types that Teradata currently supports as extensions:
Data Type
Description
Data Value Range
BYTEINT
Signed whole number
-128 to 127
BYTE (X)
Where: X=1 thru 64000
Binary
1 to 64,000 bytes
VARBYTE (X)
Where: X=1 thru 64000
Variable length binary
1 to 64,000 bytes
LONG VARCHAR
Variable length string
64,000 characters (maximum data length) The system only stores the characters provided, not trailing spaces.)
GRAPHIC (X)
Where: X=1 thru 32000
Fixed length string of 16-bit bytes (2 bytes per character)
1 to 32,000 KANJI characters
VARGRAPHIC (X)
Where: X=1 thru 32000
Variable length string of 16-bit bytes
1 to 32,000 characters as a maximum. The system only stores characters provided.

No comments: