Example: Most Significant Field in Source Higher Than Target

Teradata Vantage™ Data Types and Literals

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1143-162K

The following query first treats the source INTERVAL value as ‘135 12’ and then computes HOURS as (135*24)+12=3252. The result of the query is INTERVAL ‘3252’ HOUR unless the precision for the target value is less than 4, in which case an error is returned. The source had a data type of DAY TO SECOND.

SELECT CAST(INTERVAL '135 12:37:25.26' DAY TO SECOND AS INTERVAL HOUR);