Chapter 6. Developing Stored Subprograms and Triggers
The way you give your name to others is a measure of how much you like and respect yourself. -Brian Tracy
This chapter brings you the power of PL/SQL within your database. Stored subprograms offer distinct advantages over embedding queries in your applications as stored subprograms are more modular and tuneable. We will learn about stored procedures, functions, and packages in this chapter. Error handling is a very critical part of a program and hence is of greater importance. The following topics are discussed in this chapter:
PL/SQL data types
Stored subprograms
Creating stored subprograms
About packages
Creating packages
Wrapping the PL/SQL code
Exception handling
PL/SQL triggers
PL/SQL data types
PL/SQL provides many predefined data types. The most commonly used PL/SQL data types include NUMBER, INTEGER, VARCHAR2, DATE
, and BOOLEAN
. You assign values to variables using ":=". An example PL/SQL block, that declares variables and assigns some...