UDFs | Privileges Needed for Database Administration | Teradata Vantage - User-Defined Functions (UDFs) - Analytics Database - Teradata Vantage

SQL Data Control Language

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-03-29
dita:mapPath
sgu1628111251052.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
dvv1472243528022
lifecycle
latest
Product Category
Teradata Vantageā„¢
Goal Privileges User Needs
Create a function that calls a UDF from the SYSUDTLIB database CREATE FUNCTION privilege, on the containing database and on the SYSUDTLIB database.

If you grant a user the CREATE FUNCTION privilege on a database, any function a user creates automatically has DROP FUNCTION, EXECUTE FUNCTION, and WITH GRANT OPTION on the function.

  • Change the run mode of a function
  • Recompile or re-link a function
ALTER FUNCTION privilege.

A UDF running in protected mode runs in a process created to run as the user called tdatuser. This user has no special operating system privileges. The site must decide what resources tdatuser is to have access to by setting access privileges to system resources as required by the site.

If you specify EXECUTE NOT PROTECTED, and the function fails during run time, the database may restart.
Use the SHOW FUNCTION statement to display CREATE/REPLACE FUNCTION text and the source code At least one privilege on the function or the database containing the function to display the CREATE/REPLACE FUNCTION text.

If the user has the DROP FUNCTION privilege, the SHOW FUNCTION statement also displays the C source.

Drop a UDF DROP FUNCTION on the function or the containing database or user.
Run a function EXECUTE FUNCTION privilege on the database or specific function.

To grant the user privileges to run a specific user-defined functions, submit:

GRANT EXECUTE ON SPECIFIC FUNCTION  function_name  TO  username;

To grant run privileges on all UDFs in a database:

GRANT EXECUTE FUNCTION ON  dbname  TO  username;
Use the HELP FUNCTION to get one of the following:
  • Function name
  • List of parameters
  • Data types of parameters
  • Whether function is used to compress or decompress character or graphic data
  • Comments associated with parameters for SQL, scalar, aggregate, and table functions
At least one privilege on the function or the database containing the function.
Rename function DROP FUNCTION privilege on the function or the containing database, and the CREATE FUNCTION privilege on the database containing the function.
Replace existing function DROP FUNCTION privilege on the function or on the database containing the function.
If you specify a UDT as an input parameter or the function result, the current user must have one of the following privileges:
  • UDTUSAGE on the SYSUDTLIB database.
  • UDTUSAGE on the specified UDT.

For additional information on creating UDFs, see Teradata Vantageā„¢ - SQL External Routine Programming, B035-1147.