17.05 - USING and DateTime System Functions - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Manipulation Language

Advanced SQL Engine
Teradata Database
Release Number
January 2021
English (United States)
Last Update

In non-ANSI Vantage applications, when you access the system functions DATE or TIME, the values are obtained directly from the operating system and placed in a USING row for access by the query being performed. In this situation, the value for DATE is stored with type DATE and the value for TIME is stored with type REAL. These values are stored in known fixed fields in the USING row.

The ANSI system functions CURRENT_DATE, CURRENT_TIME, and CURRENT_TIMESTAMP behave differently:
  • CURRENT_DATE is stored in the field previously used exclusively for DATE.
  • CURRENT_TIME is not stored in the field previously used for TIME because both its storage format and its content are different and are not interchangeable with those of TIME. Another system-value field is added to the USING row. Notice that CURRENT_TIME includes TIME ZONE data in addition to the more simple TIME data, so the differences between the two extend beyond storage format.
  • CURRENT_TIMESTAMP is also stored as an additional separate field in the USING row.

You can use the legacy Teradata Database DATE and TIME functionality and the ANSI DateTime functionality with the USING request modifier.