Advantages of subprograms, PL-SQL Programming

Advantages of Subprograms

The Subprograms give extensibility; that is, tailor the PL/SQL language to suit your requirements. For illustration, if you require a procedure which creates new departments, you can easily write one, as shown below:

PROCEDURE create_dept (new_dname VARCHAR2, new_loc VARCHAR2) IS

BEGIN

INSERT INTO dept

VALUES (deptno_seq.NEXTVAL, new_dname, new_loc);

END create_dept;

The Subprograms also give modularity; that is, they break a program down into controllable, well-defined logic modules. This supports the top-down design and the stepwise refinement approach to solving a problem.

In addition, the subprograms promote reusability and maintainability. A subprogram can be used once validated with the confidence in any number of applications. When its definition changes only the subprogram is affected. These simplify the maintenance and enhancement.

At last, the subprograms aid abstraction, the mental division from particulars. To use the subprograms, you should know what they do, not how they work. And hence, you can design the applications from the top down without worrying about the implementation details. The Dummy subprograms (stubs) permit you to defer the definition of procedures and functions until you test and debug the major program.

Posted Date: 10/5/2012 5:22:02 AM | Location : United States







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

Write discussion on Advantages of subprograms
Your posts are moderated
Related Questions
Fetching Across Commits The FOR UPDATE clauses acquire exclusive all row locks. All rows are locked when you open the cursor, and when you commit your transaction they are unl

Keyword and Parameter Description: table_reference: This specifies a table or view that should be accessible when you execute the DELETE statement, and for that you must

We are seeking a freelance consultant that is familiar with Appgen applications. We require exporting all our data into a format appropriate for importing into SAP Business One. Pl

Aggregate Assignment The %ROWTYPE declaration cannot include an initialization clause. Though, there are two ways to assign values to all fields in a record at once. At First, t

Defining and Declaring Records To create records, you have to define a RECORD type, and then declare records of that type. You may also define RECORD types in the declarative

Example of EXCEPT Operator - SQL Example, like its counterpart in the theory book, illustrates the convenience of allowing any table expression to be the source for an INSERT

Inserting Objects: You can use the INSERT statement to add objects to an object table. In the illustration below, you insert a Person object into the object table persons:

Example of COALESCE operator Example: Give the total of marks for each exam (simplified solution) SELECT CourseId, COALESCE ((SELECT SUM (Mark) FROM EXAM_MARK AS EM

Parameter and Keyword Description:   table_reference: This identifies a table or view which should be available when you execute the INSERT statement, and for that you sho

BEGIN Parameter Description in pl sql: BEGIN: This keyword signals the beginning of the executable section of a PL/SQL block, that contains executable statements. The execut