16.20 - EXECUTE PROTECTED - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Syntax and Examples

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Content Type
Programming Reference
Publication ID
B035-1144-162K
Language
English (United States)
Last Update
2019-05-24

Change the execution mode for the specified function from unprotected mode to protected mode. For details, see the ALTER FUNCTION topic "When to Specify Unprotected Mode" in Teradata Vantage™ SQL Data Definition Language Detailed Topics , B035-1184 .

NOT
Change the execution mode for the specified function from protected mode to unprotected mode.
This option is not valid for Java UDFs.

Example: Setting the Protection Mode of a UDF to EXECUTE NOT PROTECTED

You have created and successfully debugged a UDF named TransXML and you now want to set its protection mode to EXECUTE NOT PROTECTED. The following request assumes there is no other UDF in the database named TransXML:
     ALTER FUNCTION TransXML EXECUTE NOT PROTECTED;

Example: Setting a Recompiled UDF to EXECUTE NOT PROTECTED

An existing UDF named XPathValue must be recompiled for some reason. XPathValue had previously been set to run in unprotected mode. Recompiling a UDF always resets its protection mode back to protected, so you must follow any recompilation with another ALTER FUNCTION request to set its protection mode back to unprotected.

These statements recompile XPathValue and then set its protection mode back to unprotected:
     ALTER FUNCTION XPathValue COMPILE;
     ALTER FUNCTION XPathValue EXECUTE NOT PROTECTED;