Skip to main content

Datometry Documentation

Translate Teradata TRYCAST to TIMESTAMP Function

Hyper-Q can translate the Teradata TRYCAST to TIMESTAMP function. TRYCAST takes a string and casts it to the specified data type—in this case TIMESTAMP.

Important

Translating TRYCAST functions to TIMESTAMP is computationally expensive, and may impact performance. For this reason, timestamp_trycast is disabled by default. While you can specify timestamp_trycast as a global setting in the Hyper-Q configuration file (dtm.ini) Datometry recommends implementing this selectively as a query hint on specific SQL queries as necessary.

The syntax for timestamp_trycast is:

timestamp_trycast = true | false

where:

Parameter

Description

true

Specifies that Hyper-Q translate the Teradata TRYCAST to TIMESTAMP data type.

false

By default, timestamp_trycast is disabled, or set to false.

Hint Scope

The timestamp_trycast hint can be specified at the statement, request, session, and global level. To learn more about Hyper-Q SQL hints, and how to use them within a SQL query, see About Hyper-Q SQL Hints.

Example 64. Specify TRYCAST to TIMESTAMP Translation as a Global Setting

You can specify timestamp_trycast as a global setting in the Hyper-Q configuration file (dtm.ini). To enable timestamp_trycast, set it to true.

"gateway".timestamp_trycast = true

To learn more about specifying a hint as a [gateway] option in the Hyper-Q configuration file, see Gateway Configuration Parameters.



Example 65. Specify TRYCAST to TIMESTAMP Translation as a Query Hint

You can specify timestamp_trycast as a query hint.

SELECT TRYCAST 
@ dtm_timestamp_trycast = true 
('2000-09-20 10:44:25.222' AS TIMESTAMP(2)); 

To learn more about Hyper-Q SQL hints, and how to use them within a SQL query, see About Hyper-Q SQL Hints.