Conversion (Teradata Database) - Teradata Warehouse Miner

Teradata Warehouse Miner User Guide - Volume 2ADS Generation

Product
Teradata Warehouse Miner
Release Number
5.4.5
Published
February 2018
Language
English (United States)
Last Update
2018-05-03
dita:mapPath
qhj1503087326201.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2301
Product Category
Software

The following table lists the available conversion functions, and a description of their purpose.

Embedded Services: Conversion Functions
Function Description
NUMTODSINTERVAL Converts numeric_value into an INTERVAL DAY(4) TO SECOND(6) value.
NUMTOYMINTERVAL Converts numeric_value into an INTERVAL YEAR(4) TO MONTH value.
TO_CHAR Converts numeric_expr to a character string.
TO_DATE Converts string_expr to a DATE data type.

TO_DATE does not convert data to any of the other datetime data types. Do not use the TO_DATE function with a DATE value for string_expr. The first two digits of the returned DATE value can differ from the original string_expr depending on format_arg or the default date format.

TO_NUMBER Converts string_expr to a NUMBER data type.
TO_TIMESTAMP Converts string_expr or integer_expr to a TIMESTAMP data type.
TO_TIMESTAMP_TZ Converts string_expr to a TIMESTAMP WITH TIME ZONE data type.
TO_DSINTERVAL Converts string_value specified as either of the following:
  • SQL interval format
  • ISO duration format

into an INTERVAL DAY(4) TO SECOND(6) value.

Any value that overflows the INTERVAL DAY(4) TO SECOND(6) value results in an error.

TO_YMINTERVAL Converts string_value specified as either:
  • SQL interval format
  • ISO duration format

into an INTERVAL YEAR(4) TO MONTH value.

Any value that overflows the INTERVAL(4) YEAR TO MONTH value results in an error.

See the Teradata Database SQL Functions, Operators, Expressions, and Predicates document, B035-1145, for a detailed overview of these conversion functions.