This is a book about writing stored procedures for an Oracle database. A stored procedure in this context is
a generic term for a program written in the Procedure Language extension for SQL (PL/SQL) that is stored
inside the database when it is compiled. This means that you can then execute the program from inside the
database. Why would you want to do this? Because your program will run faster inside the database.
Let’s slow down for a minute, so I can explain what a stored procedure is and why you would want to
What’s a Stored Procedure?
In order for me to talk about stored procedures, I need to cover a little material on databases and networks
first. By now, you’ve probably already seen three of the four diagrams I’m about to show you a few hundred
times, but bear with me so I can make sure everyone is on the same page as we start out.
I’m going to assume, since you’re ready to start writing programs against an Oracle database, that you
already know what a relational database management system (RDBMS) is. For our purposes, an RDBMS,
or database as I’ll refer to it from here forward, is a hardware/software machine (server) that allows us
to store, retrieve, and manipulate data in a predictable and organized manner using Structured Query
SQL acts as the interface to the database. A client program, whether it exists on the same computer or
on another, makes a connection to the database, sends a request in the form of SQL to the server, and in
return gets back structured data