15.10 - AT TIME ZONE - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K

The specification that follows sets the time zone for the procedure. You can only specify AT TIME ZONE if you precede it with either the COMPILE option or the COMPILE ONLY option.
You cannot specify AT TIME ZONE by itself or following the EXECUTE PROTECTED or EXECUTE NOT PROTECTED options.


LOCAL

Set the time zone for the procedure to the system default.

signquotestring
Set the procedure time zone offset to ± ‘quotestring’.
The specification of a sign is optional. The default is +.
Teradata Database implicitly converts the specified expression, as needed and if allowed, to a time zone displacement or time zone string.
See “SET TIME ZONE” in SQL Data Definition Language Detailed Topics for a complete list of the implicit data type conversions Teradata Database performs on ± ‘quotestring’ data types.

Example: Using the AT TIME ZONE Option with an External Procedure

This example illustrates the AT TIME ZONE option with a C-language external procedure named spa_tz.

     ALTER PROCEDURE spa_tz
     COMPILE AT TIME ZONE LOCAL;

The AT TIME ZONE option is only valid when you specify it following either the COMPILE option or the COMPILE ONLY option.

For example, the following request is not valid because the AT TIME ZONE specification precedes the COMPILE specification in the request.

     ALTER PROCEDURE spa_tz
     LANGUAGE C
     AT TIME ZONE COMPILE 'gmt';

The same request, when the options are specified in the correct sequence, is valid and alters the procedure as requested.

     ALTER PROCEDURE spa_tz
     LANGUAGE C
     COMPILE AT TIME ZONE 'gmt';