In this chapter, you learned that
PL/SQL (Procedural Language/SQL) is built on top of SQL and is a third generation programming language.
PL/SQL programs are divided up into blocks with each block containing PL/SQL and SQL statements.
You may use a loop, such as a WHILE or FOR loop, to run one or more statements multiple times.
You use a cursor when you have a SELECT statement that returns more than one row from the database. You retrieve the rows into the cursor using your SELECT statement and then fetch the rows from the cursor.
Exceptions are used to handle errors that occur in your PL/SQL code.
A procedure contains a group of SQL and PL/SQL statements. Procedures allow you to centralize your business logic in the database and may be used by any program that accesses the database.
A function is similar to a procedure except that a function must return a value to the statement from which it is called.
You can group procedures and functions together into packages, which allow you to encapsulate related functionality into one self-contained unit. Packages are typically made up of two components : a specification and a body.
A trigger is a procedure that is run automatically by the database when a specified SQL DML INSERT , UPDATE, or DELETE statement is run against a specified database table. Triggers are useful for doing things like advanced auditing of changes made to column values in a table.
In the next chapter, you ll learn about database objects.