ALTER FUNCTION Examples | Teradata Vantage - ALTER FUNCTION Examples - Analytics Database - Teradata Vantage

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
Product Category
Teradata Vantage™

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;