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

Teradata Vantage™ - SQL Data Control Language

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
17.05
created_date
June 2020
category
Programming Reference
featnum
B035-1149-170K
To... the user must have...
create a function that calls a UDF from the SYSUDTLIB database the 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 execution mode of a function
  • recompile or re-link a function
the 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. It is up to the site to 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 execution, the database could 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 the DROP FUNCTION on the function or the containing database or user.
execute a function the EXECUTE FUNCTION privilege on the database or specific function.

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

GRANT EXECUTE ON SPECIFIC FUNCTION  function_name  TO  username;

To grant execute privileges on all UDFs in a database:

GRANT EXECUTE FUNCTION ON  dbname  TO  username;
use the HELP FUNCTION to get:
  • the function name
  • a list of parameters
  • the data types of the parameters
  • whether the function is used to compress or decompress character or graphic data
  • any comments associated with the parameters for SQL, scalar, aggregate, and table functions
at least one privilege on the function or the database containing the function.
rename a function the DROP FUNCTION privilege on the function or the containing database, and the CREATE FUNCTION privilege on the database containing the function.
replace an existing function the 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 .