Set privileges for support functions

The CREATE FUNCTION statement registers a function with the Execute privilege granted to the owner of the support function and the DBA. Such a function is called an owner-privileged function.

To execute a support function in an SQL statement, the user must have the Execute privilege. Usually, the default privilege is adequate for support functions that are implicit casts because implicit casts should not generally be called within SQL statements. Support functions that are explicit casts might have the Execute privilege granted so that users can call them explicitly. The owner grants the Execute privilege to other users with the EXECUTE ON clause of the GRANT statement.

The sysprocauth system catalog table stores routine-level privileges. This table contains privileges for each UDR and therefore for all support functions that are defined in the database. The table contains one row for each set of privileges granted.