Previous |
Next |
A package always has a specification, and it usually has a body.
The package specification defines the package, declaring the types, variables, constants, exceptions, explicit cursors, and subprograms that can be referenced from outside the package. A package specification is an application program interface (API): It has all the information that client programs need to call its subprograms, but no information about their implementation.
The package body defines the queries for the explicit cursors, and the code for the subprograms, that are declared in the package specification (therefore, a package with neither explicit cursors nor subprograms does not need a body). The package body can also define local subprograms, which are not declared in the specification and can be invoked only by other subprograms in the package. Package body contents are hidden from client programs. You can change the package body without invalidating the applications that call the package.
Oracle Database PL/SQL Language Reference for more information about the package specification
Oracle Database PL/SQL Language Reference for more information about the package body