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