UDFs | Privileges Needed for Database Administration | Teradata Vantage - User-Defined Functions (UDFs) - Advanced SQL Engine - Teradata Database

SQL Data Control Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
lmb1556233084626.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1149
lifecycle
previous
Product Category
Teradata® Vantage™ NewSQLEngine
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 .