10.1. Procedures

A PL/SQL procedure is a stand-alone program that you compile into an Oracle database schema. Procedures can accept arguments. When you compile a procedure, the procedure identifier of the CREATE PROCEDURE statement becomes the object name in the data dictionary. Figure 10-1 illustrates the components and keywords of a procedure. This structure applies for a stand-alone procedure and the procedure code of a package body.

Figure 10-1. Procedure.

The key components of a procedure to which you write code are the following:

Declarative PartThis is where you declare variables, for example:

local_counter NUMBER := 0;

You may also have ...

Get Programming Oracle® Triggers and Stored Procedures, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.