8 Pl Sql Subprograms

What Are Subprograms?

Subprograms are named PL/SQL blocks that can take parameters and be invoked. PL/SQL has two types of subprograms called procedures and functions. Generally, you use a procedure to perform an action and a function to compute a value.

Advantages of Subprograms

Subprograms provide extensibility; that is, they let you tailor the PL/SQL language to suit your needs.
Subprograms also provide modularity; that is, they let you break a program down into manageable, well-defined modules.
Finally, subprograms aid abstraction, the mental process of deriving a universal from particulars.

Understanding PL/SQL Procedures

A procedure is a subprogram that performs a specific action.

Understanding PL/SQL Functions

A function is a subprogram that computes a value. Functions and procedures are structured alike, except that functions have a RETURN clause.

Using the RETURN Statement

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.