Monday, 22 February 2016

PACKAGES

PACKAGE:
             A Package is an Oracle Object,which holds other Objects within it. Objects commonly held within a Package are Procedures, Functions,Variables,Constants,Cursors and Exceptions.

COMPONENTS OF PACKAGES:
            A Package has usually two components, a specification and a body.
            A Package's Specification's declares the types(Variables of the record type) memory.Variables,Constants,Exceptions,Cursors & Subprograms that are available for use.
           A Package's body fully defines Cursors,Functions and Procedures and thus implements the specification.

PACKAGE SPECIFICATION CONTAINS 


  • Name of the Package
  • Names of the Data Types of any arguments this declaration is local to the database and global to the Package.
  • This means that Procedures,Functions,Variables,Constants,Cursors and Exceptions & other Objects,declared in a Package are accessible from anywhere in the Package.
  • Therefore all the information a Package needs to execute a stored sub programs contained in the Package itself.

PACKAGE BODY CONTAINS

  • The Body of a Package contains the definition of public Object that are declared in specification.
  • The Body can also contain other Object declarations that are private to package.
  • The Object declare privately in package body that are not accessible to other Object outside the Package.

ADVANTAGES OF PACKAGE:

  • Packages Enable the Organisation of commercial applications into efficient modules.
  • Each Package easily understood and interfaces between Packages are simple,clear and well defined.
  • Packages Enables Overloading of Procedures & Functions if required.
  • Packages improves the performance by loading multiple objects into the memory at once.

 




No comments:

Post a Comment

If you Like my blog Spread it and help friends for whom this blog is useful for their career.