Internal Representation of TIMESTAMP
Conceptually, TIMESTAMP is treated as a record composed of six fields, defined appropriately for the Gregorian calendar.
|Field Name||Minimum Value||Maximum Value||Storage Format|
This value accounts for leap seconds that can be added to the clock.
|DAY||01||28, 29, 30, or 31
(depending on the month and year)
Although the record is composed of numeric fields, it is not treated as a numeric value.
The length of the internal stored form is 10 bytes.
External Representation of TIMESTAMP
TIMESTAMP types are imported and exported in record and indicator modes as CHARACTER data using the ANSI format string and the site-defined client character set.
|WHEN fractional_seconds_precision is …||THEN the type is …||AND the format is …|
where n is 1 - 6
The following table shows examples of how TIMESTAMP types are exported in record and indicator modes.
|WHEN fractional_seconds_precision is …||THEN length is …||FOR example …|
For information about the TIMESTAMP formats and how to change them, see TIME and TIMESTAMP Formats.
Implicit and Explicit TIMESTAMP Conversion
Vantage performs implicit conversion from CHARACTER to TIMESTAMP types during assignment and comparison. This conversion is supported for CHAR and VARCHAR types only. You cannot convert a character data type of CLOB or CHAR/VARCHAR CHARACTER SET GRAPHIC to TIMESTAMP.
Vantage also performs implicit conversions from TIMESTAMP to DATE and TIME types. However, implicit TIMESTAMP to TIME conversion is not supported for comparisons.
You can use CAST to explicitly convert CHARACTER to TIMESTAMP types and from TIMESTAMP to DATE or TIME types.
For more information, see Teradata Vantage™ - SQL Functions, Expressions, and Predicates, B035-1145.