Advantages of packages, PL-SQL Programming

Advantages of Packages

The benefits of the Packages are as shown below:

Modularity

The Packages encapsulate logically associated items, types, and subprograms in the named PL/SQL module. Every package is easy to understand, & the interfaces between the packages are clear, simple, and well defined. This aids the application development.

Easier Application Design

When creating an application, all you require initially is the interface information in the package specification. You can code and gather the specification without its body. Then stored the subprograms that reference the package can be compiled as well. You need not define the package bodies completely until you are ready to complete the application.

Information Hiding

With the packages, you can state which items, types, and subprograms are public or private. For illustration, if a package has 4subprograms, 3 might be public and one private. The package hide the explanation of the classified subprogram so that only the package is affected if the definition changes. These simplify the maintenance & enhancement. Also, by hiding the implementation details from the users, you secure the integrity of the package.

Added Functionality

The Packaged public variables and cursors continue for the duration of the session. Therefore, they can be shared by all the subprograms which execute in the atmosphere. Also, they permit you to maintain the data across transactions without having to store it in the database.

Better Performance

When you call the packaged subprogram for the first time, the entire package is burdened into the memory. And hence, the later calls to correlated subprograms in the package need no disk I/O. Also, the packages stop cascading dependencies and thereby avoid needless recompiling. For illustration, if you change the definition of a packaged function, the Oracle need not recompile the calling subprograms as they do not depend on the package body.

Posted Date: 10/5/2012 5:59:21 AM | Location : United States







Related Discussions:- Advantages of packages, Assignment Help, Ask Question on Advantages of packages, Get Answer, Expert's Help, Advantages of packages Discussions

Write discussion on Advantages of packages
Your posts are moderated
Related Questions
Using NOT NULL Besides assigning an initial value, the declarations can impose the NOT NULL constraint, as the example below shows: acct_id INTEGER(4) NOT NULL := 9999; You ca

INSERT Statement The INSERT statement adds fresh rows of data to the specified database table or view. Syntax:

This is a Customer Management project. Customer data is presented in a text file. The program will load this text data into its DB columns. The data mapping is user definable. User

%ISOPEN The %ISOPEN yields TRUE if its cursor or cursor variable is open; or else, the %ISOPEN yields FALSE. In the illustration, you use the %ISOPEN to select an action:

Keyword and Parameter Description: label_name: This is an undeclared identifier which optionally labels the PL/SQL block. When used, label_name should be enclosed by the do

Extension and AND in SQL The theory book gives the following simple example of relational extension in Tutorial D: EXTEND IS_CALLED ADD ( FirstLetter ( Name ) AS Initial )

Fetching with a Cursor The FETCH statements retrieve the rows in the result set one at a time. After each and every fetch, the cursor advance to the next row in the result set

Fetching from a Cursor Variable The FETCH statement retrieve rows one at a time from the product set of a multi-row query. The syntax for the same is as shown: FETCH {curso

Create a procedure named DDPROJ_SP that retrieves project information for a specific project based on a project ID. The procedure should have two parameters: one to accept a projec

Example of WHEN or THEN Constraints A concrete example showing how SQL supports WHEN/THEN constraints CREATE TABLE SAL_HISTORY (EmpNo CHAR (6), Salary INTEGER NOT NULL,