Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , ,

Sponsored Links


Packages in oracle database

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 30-01-2010
Member
 
Join Date: Jan 2010
Posts: 53
Packages in oracle database

Sponsored Links
What is the use of packages in oracle database,another facility of database like functions and procedures are available. what is the purpose of creating packages and how it would be constructed. what is the difference between bodiless and normal packages.

Reply With Quote
  #2  
Old 30-01-2010
Praetor's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,943
Packages in oracle database

Packages:
A package is constructed using the collection of some procedures, functions, variables and SQL statements which is treated as a single unit.A package having two sections :

1. Package Specification
2. Package Body.

The first part of the package contains some declaration like variables ,types,exceptions,cursor ,etc and on other hand the second part of the package body contains some valuable code that builds a package.
Reply With Quote
  #3  
Old 30-01-2010
Member
 
Join Date: May 2008
Posts: 2,000
Packages in oracle database

Creating specification of Package:

A package specification act as an interface for package.It contains some declaration of variable and required specification for body construction.

The syntax would be as follows;

Code:
PACKAGE Package_name
 IS
[Declaration of variables and types] 
[specification of cursor]
[specification of modules]

END [Package_name];
Reply With Quote
  #4  
Old 30-01-2010
kelfro's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,989
Packages in oracle database

Creating package body:

Package body holds all the code and implement the subprograms, queries. It generate the some action with the help of specification packages and helps to retrieve the required information through the constructed package.

The syntax would be as follows :

Code:
PACKAGE BODY Package_name
 IS
 [Declaration of variables and types] 
    [specification and SELECT statement of cursor]
       [specification and body of modules]
           [BEGIN 
             executable statements ]

[EXCEPTION exception handlers]

         END [Package_name];
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Packages in oracle database"
Thread Thread Starter Forum Replies Last Post
Joins in oracle database Adriana_andros Software Development 5 11-02-2010 07:53 PM
Dynamic SQL in Oracle database Adriana_andros Software Development 5 11-02-2010 06:49 PM
Cursor in oracle database Ainsley Software Development 5 11-02-2010 05:24 PM
The synonyms in oracle database Norse Software Development 4 02-02-2010 09:46 PM
Oracle Announces TimesTen In-Memory Database 11g and In-Memory Database Cache 11g prakashseth Web News & Trends 1 30-07-2009 04:58 PM


All times are GMT +5.5. The time now is 07:21 AM.