ALTER FUNCTION Examples | VantageCloud Lake - ALTER FUNCTION Examples - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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. XPathValue had previously been set to run in unprotected mode. Recompiling a UDF 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;