|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.
||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||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:
||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.|
- 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 .