Authorization ID validation
Db2 uses the rules for static SQL to determine the authorization ID (invoker) that executes the user-defined function package. For a static statement, the invoker is the authorization ID of the plan or package owner.
The invoking package SALARY_ADJ contains a static
SQL SELECT statement that invokes the user-defined function SALARY_CHANGE.
- While execution occurs in invoking package SALARY_ADJ, Db2 uses the authorization ID of
the invoker (the package owner).
The invoker requires the EXECUTE privilege on the user-defined function SALARY_CHANGE, which the package SALARY_ADJ invokes. Because the user-defined function definer has the EXECUTE privilege on the user-defined function package C_SALARY, the invoker does not require the explicit EXECUTE privilege.
- When execution changes to the user-defined function package C_SALARY, Db2 uses the authorization ID of
the implementer (the package owner). The package owner is the authorization
ID with authority to execute all static SQL in the user-defined function
package C_SALARY.