Oracle8i Supplied Packages Reference Release 8.1.5 A68001-01 |
|
This reference manual describes the Oracle packages that are shipped with the Oracle8i, Release 8.1.5 program. Information in this manual applies to versions of the Oracle Server that run on all platforms, and it does not include system-specific information.
This Preface includes the following sections:
A package is a schema object that groups logically related PL/SQL types, items, and subprograms. Packages usually have two parts: a specification and a body, although sometimes the body is unnecessary. The specification is the interface to your applications; it declares the types, variables, constants, exceptions, cursors, and subprograms available for use. The body fully defines cursors and subprograms, and so implements the specification.
Unlike subprograms, packages cannot be called, parameterized, or nested. Still, the format of a package is similar to that of a subprogram:
CREATE PACKAGE name AS -- specification (visible part) -- public type and item declarations -- subprogram specifications END [name]; CREATE PACKAGE BODY name AS -- body (hidden part) -- private type and item declarations -- subprogram bodies [BEGIN -- initialization statements] END [name];
The specification holds public declarations, which are visible to your application. The body holds implementation details and private declarations, which are hidden from your application.
You can debug, enhance, or replace a package body without changing the interface (package specification) to the package body.
To create packages and store them permanently in an Oracle database, use the CREATE
PACKAGE
and CREATE
PACKAGE
BODY
statements, which you can execute interactively from SQL*Plus or Enterprise Manager.
Only the declarations in the package specification are visible and accessible to applications. Implementation details in the package body are hidden and inaccessible. So, you can change the body (implementation) without having to recompile calling programs.
The advantages of using packages include modularity, easier application design, information hiding, added functionality, and better performance.
This manual is intended for anyone who is using or is interested in Oracle packages. It will also be valuable to systems analysts, project managers, and others interested in the development and tuning of database applications.
This manual assumes that you have a working knowledge of application programming and that you are familiar with the use of Structured Query Language (SQL) to access information in relational database systems.
Certain sections of this manual also assume a knowledge of the basic concepts of object oriented programming.
For more information, see the following manuals in the Oracle8i documentation set:
The following conventions are used in this manual:
We value and appreciate your comments as an Oracle user. As we write, revise, and evaluate our documentation, your opinions are the most important feedback we receive.
You can send comments and suggestions about this manual to the following e-mail address:
If you prefer, you can send letters or faxes containing your comments to the following address:
Server Technologies Documentation Manager
Oracle Corporation
500 Oracle Parkway
Redwood Shores, CA 94065
Fax: (650) 506-7228