The PROCEDURE Section

The PROCEDURE section is the only mandatory part of a PL/SQL block. This part of the block calls variables and uses cursors to manipulate data in the database. The PROCEDURE section is the main part of a block; it contains conditional statements and SQL commands.

BEGIN...END

In a block, the BEGIN statement denotes the beginning of a procedure. Similarly, the END statement marks the end of a procedure. The following example shows the basic structure of the PROCEDURE section:

BEGIN
  open a cursor;
  condition1;
    statement1;
  condition2;
    statement2;
  condition3;
    statement3;
.
.
.
  close the cursor;
END

Cursor Control Commands

Now ...

Get Sams Teach Yourself SQL in 21 Days, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.