A package is a named collection of functions, procedures, variables, cursors, user-defined record types, and records that are referenced with the package identifier.

The following section shows the characteristics of packages:

  • Packages provide a convenient method to organize the functions and procedures to achieve a certain purpose. The permission to use the package functions and procedures is based on one privilege granted to the entire package. All of the package programs must be referenced with a common name.
  • Certain functions, procedures, variables, and types in the package can be declared as public. Public entities are visible and can be referenced by other programs that are granted the EXECUTE permission on the package. For public functions and procedures, only the signatures such as program names, parameters, and return types are visible. The Structured Process Language (SPL) code of these functions and procedures cannot be accessed by others. Therefore, applications that utilize a package depend on only the information available in the signatures instead of the procedural logic.
  • Other functions, procedures, variables, types in the package can be declared as private. Private entities can be referenced and used by functions and procedures within the package, but cannot be referenced and used by external applications. Private entities are used only by programs within the package.
  • Function names and procedure names can be reloaded within a package. One or more functions and procedures can be defined with the same name but different signatures. This allows you to create multiple programs with the same name. These programs run the same jobs based on different types of input.