When a package is reloaded, the owner of the package is assigned the appropriate run privilege. If NEW or REPLACE REVOKE is one of the RELOAD parameters, the only privilege for the package is the owner's run privilege. The user ID for the owner of the reloaded package must exist so that the necessary privileges can be granted. A user with DBA authority can reload a package without being the owner and can grant the RUN privileges to other users. For more information on package privileges, see the DB2 Server for VSE & VM Application Programming manual.
Errors with RELOAD |
---|
The Database Services Utility SET ERRORMODE CONTINUE command can be used with the RELOAD PACKAGE command. If an error occurs during reloading of the package on an application server, RELOAD processing ends on that application server. RELOAD processing then continues on subsequent application servers listed in the TO clause if ERRORMODE CONTINUE processing is in effect and the error is not severe. |
Example of Authorizing the Use of Packages |
---|
Gene writes an application program GENE.TTIME to display each employee's working hours to date. The table containing this information is HOURS.TOTAL. This program is to be distributed to all the offices and installed by a user with DBA authority at each site. When the DBA reloads this new package, only the owner (GENE) possesses the RUN privilege. This privilege is granted during the RELOAD. The user ID GENE must exist for the DBA to be able to grant the RUN privilege for the package GENE.TTIME. GENE must also have the necessary table privileges to run the package successfully. |
To preprocess and distribute the SQL application created by Gene in the above example, the company proceeds as follows:
To set up and run the application described in Preprocessing and Distributing an Application, the company proceeds as follows: