Chapter 7. Program Construction

There are three kinds of programs (also known as modules) in PL/SQL:

Procedure

A procedure is a program that executes one or more statements. It’s called as a standalone statement.

Function

A function is a program that executes one or more statements and returns a value. It’s called within an expression (assignment statement, conditional expression, etc.).

Trigger

A trigger is a program whose execution is “triggered” by some event, usually a SQL operation on a table or column within a table.

All of these are named, executable code units. A package, as described in Chapter 8, is a container for procedures and/or functions, as well as data. Packages, therefore, aren’t executable objects themselves.

Get Oracle PL/SQL Best Practices 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.