Thursday, September 9, 2010 20:24

Oracle Package

Tagged with:
Posted by Rexleed on Monday, December 29, 2008, 13:35
This news item was posted in Oracle category and has 0 Comments so far.

A package is a group of procedures, functions, variables and SQL statements created as a single unit. It is used to store together related objects. A package has two parts, Package Specification or spec or package header and Package Body.

Package Specification acts as an interface to the package. Declaration of types, variables, constants, exceptions, cursors and subprograms is done in Package specifications. Package specification does not contain any code.

Package body is used to provide implementation for the subprograms, queries for the cursors declared in the package specification or spec.

Advantages:

  • It allows you to group together related items, types and subprograms as a PL/SQL module.
  • When a procedure in a package is called entire package is loaded, though it happens to be expensive first time the response is faster for subsequent calls.
  • Package allows us to create types, variable and subprograms that are private or public

References:

http://www.exforsys.com/tutorials/oracle-9i/oracle-packages.html

http://www.lsbu.ac.uk/oracle/oracle7/server/doc/SCN73/ch14.htm

http://download.oracle.com/docs/cd/B10500_01/appdev.920/a96624/09_packs.htm

Related Posts

Leave a Reply

You can leave a response, or trackback from your own site.