Technical Training
Oracle 9i TrainingOracle 9i Packages Page - 2
Oracle 9i Packages
Private and Public Items in packages
Items declared in package body are private. They can only be accessed within the package. Where as items declared in package specification is public and is available outside package. It is explained in the following example.
The package shown in Fig 1 contains a variable Age_limit which is accessed by the program given below.

Overloading Packaged Subprograms:
Similar to the overloading concept in other programming languages PL/SQL also allows you to overload its subprograms.
We can have more than one subprogram with the same name within a package
Following examples better explain this concept.



Writing Cursor spec and body separately using Packages
The cursor specification can be written separate from its body using packages. It allows you to change cursor body without changing the cursor specification. Cursor coded in the package spec need to have a return type.
CURSOR cursor_name [(parameter [, parameter]...)] RETURN return_type;
The following examples explain how cursor can be declared and defined using packages.


Below given is the example that explains how to access the cursor values.

Oracle 9i Training
- Oracle 9i Utilities
- Oracle 9i Packages
- Oracle 9i Database Triggers
- Oracle 9i Procedures and Functions
- Oracle 9i PL/SQL Collections
- Oracle 9i Exception Handling
- Download example SQL Scripts used in Oracle 9i Tutorials
- Oracle 9i Cursors
- Oracle 9i PL/SQL Control Structures
- Building PL/SQL Blocks in Oracle 9i
- Oracle 9i Tables and Constraints
- More Oracle 9i Database Objects
- Introduction to Oracle 9i SQL, PLSQL, and SQL *Plus
- Oracle 9i Software Installation, SQL, PLSQL and SQL *Plus References







