Guidelines for Using the CURRENT_TIME and CURRENT_TIMESTAMP Functions in an SQL Procedure - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jbg1472252759029
lifecycle
latest
Product Category
Teradata Vantage™

When you create a procedure that contains the CURRENT_TIME or CURRENT_TIMESTAMP functions, Vantage incorporates the value for the function at the time the procedure is compiled using the time or time zone value for the creator of the function based on the local session time zone settings of the DBS Control parameters SystemTimeZoneHour and SystemTimeZoneMinute.

If you adjust the settings of these parameters to make a time zone adjustment, any procedure created with the intent of returning a current value for the CURRENT_TIME or CURRENT_TIMESTAMP functions that is adjusted for the local time no matter where the procedure is invoked will not return the intended result.

You could recompile the procedure periodically, but that is not a universally applicable solution to the problem.

The best practice is to insert an appropriate time zone string into the tdlocaledef file for your site. That way, Vantage automatically makes the necessary time zone changes, ensuring that the CURRENT_TIME and CURRENT_TIMESTAMP functions within the procedure always return an appropriate value.

See Time Zone Strings for a complete list of valid time zone strings.