ALTER PROCEDURE Examples | Teradata Vantage - ALTER PROCEDURE Examples (External Form) - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

Example: Recompiling an External Procedure

This example recompiles the C-language external procedure named my_xsp.

    ALTER PROCEDURE my_xsp LANGUAGE C COMPILE;

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';

Example: Altering the Protection Mode of an External Procedure

This example changes the protection mode of the C-language external procedure named my_xsp from protected to not protected.

ALTER PROCEDURE my_xsp LANGUAGE C EXECUTE NOT PROTECTED;