A script-enabled browser is required for this page to function properly.

About PL/SQL Packages

A package is a PL/SQL construct that groups logically related types, objects, procedures, and functions. Packages usually have two parts, a specification and a body, although sometimes the body is unnecessary.

The specification is the interface to the package; it declares the types, variables, constants, exceptions, cursors, and subprograms (procedures and functions) available for use. The body fully defines cursors and subprograms, and so implements the specification.

Oracle Forms provides several predefined packages that you can use, or you can define your own packages in form, menu, or library modules. You can also define packages in the Oracle Server, and then reference their contents from client-side applications. For information on using stored procedures with Oracle Forms, see About Stored Programs .

The syntax for a package is similar to that for a procedure:

PACKAGE name IS -- specification
-- public type and object declarations
-- subprogram specifications
END [name];
PACKAGE BODY name IS --body (hidden part)
-- private type and object 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.

Only subprograms and cursors have an underlying implementation or definition. So, if a specification declares only types, constants, variables, and exceptions, the package body is unnecessary.

Only the declarations in the package specification are visible and accessible to your application. Implementation details in the package body are hidden and inaccessible. You can code and compile the specification separately. Once the specification has been compiled, you can successfully compile any triggers or user-named subprograms that reference the specification. You need not define the package body fully until you are ready to complete the application.

Note: If you later change a package, then any forms or menus that call the package may need to be recompiled as well.