alt
Advertisement
Sponsored links
Online Training
Career Series
Exforsys
Exforsys arrow Tutorials arrow Oracle 9i arrow Tutorial 15: Oracle 9i : Oracle Packages
Site Search


Tutorial 15: Oracle 9i : Oracle Packages
Article Index
Tutorial 15: Oracle 9i : Oracle Packages
Page 2

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.


Download Sample Scripts


Trackback(0)
Comments (3)add comment

arul1 said:

  pl/sql packeges concepts are easy to understand
August 02, 2007

hasan amin said:

  thanx a billion , where million is too little :) for this clear , helpful and specific explanation .
it really helped me and made that stuff crystal clear to me ..
thanx again .
May 27, 2008

Lokesh Devanga said:

  You will provide somemore Examples
June 18, 2008

Write comment

busy

 
< Prev   Next >
Exforsys Offers
© 2008 Exforsys.com
Joomla! is Free Software released under the GNU/GPL License.
Page copy protected against web site content infringement by Copyscape