PL/SQL package definitions are supported by the DB2® data server. A PL/SQL package
is a named collection of functions, procedures, variables, cursors,
user-defined types, and records that are referenced using a common
qualifier, the package name.
Packages have the following characteristics:
- Packages provide a convenient way of organizing the functions
and procedures that have a related purpose. Permission to use the
package functions and procedures is dependent upon one privilege that
is granted to the entire package.
- Certain items in a package can be declared public. Public entities
are visible and can be referenced by other programs that hold the
EXECUTE privilege on the package. In the case of public functions
and procedures, only their signatures are visible. The PL/SQL code
for these function and procedures is not accessible to others; therefore,
applications that utilize such a package are dependent upon only the
information that is available in the signatures.
- Other items in a package can be declared private. Private entities
can be referenced and used by functions and procedures within the
package, but not by external applications.