Managing implicit privileges through plan or package ownership

If you are the owner of a plan or package, you must hold privileges to perform actions on the plan or package. You can grant privileges to execute the plan or package to any ID.

Begin general-use programming interface information.When the EXECUTE privilege on a plan or package is granted to an ID, the ID can execute a plan or package without holding the privileges for every action that the plan or package performs. However, the ID is restricted by the SQL statements in the original program.

Example: The program might contain the following statement:

EXEC SQL
  SELECT * INTO :EMPREC FROM DSN8B10.EMP
    WHERE EMPNO='000010';

The statement puts the data for employee number 000010 into the host structure EMPREC. The data comes from table DSN8B10.EMP, but the ID does not have unlimited access to DSN8910.EMP. Instead, the ID that has EXECUTE privilege for this plan can access rows in the DSN8B10.EMP table only when EMPNO = '000010'.

If any of the privileges that are required by the package are revoked from the owner, the package is invalidated. The package must be rebound, and the new owner must have the required privileges.End general-use programming interface information.