Recompiling a Stored Procedure | Teradata Vantage - Recompiling a Stored Procedure - Teradata Vantage - Analytics Database

SQL Stored Procedures and Embedded SQL

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2023-10-30
dita:mapPath
frc1628111662093.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
rjx1472253414573
lifecycle
latest
Product Category
Teradata Vantageā„¢

You must recompile your stored procedures whenever you upgrade or migrate to or across a major release. Use the ALTER PROCEDURE statement to recompile a stored procedure.

AT TIME ZONE Option for SQL Procedures

When you create an SQL procedure, Vantage stores the current session time zone for the procedure along with its definition to enable the SQL control language elements and the SQL statements in the procedure to execute in a consistent time zone and produce consistent results. However, time or timestamp data passed as an input parameter to the procedure still use the runtime session time zone rather than the creation time zone for the procedure.

The AT TIME ZONE option enables you to reset the time zone for all of the SQL elements of SQL procedures when you recompile a procedure. Vantage then stores the newly specified time zone as the creation time zone for the procedure.

You can only specify AT TIME ZONE with the COMPILE [ONLY] option, and it must follow the COMPILE [ONLY] specification. If it does not, Vantage aborts the request and returns an error to the requestor.

Limitation on the Use of TimeZone Strings

When using standard Teradata system time zone strings, no time zone rules are enforced for the years 1986 and before, for example, DST shifts. Valid years for Teradata standard time zone strings are 1987 through 9999.

If Teradata standard time zone strings do not meet your requirements, you can add a new custom time zone string or modify an existing string by modifying or adding new rules to GetTimeZoneDisplacement.

For more information about the SQL form of ALTER PROCEDURE, see Teradata Vantageā„¢ - SQL Data Definition Language Syntax and Examples, B035-1144.