|
||
Lesson 2
Objective
|
PL/SQL block guidelines
Describe the basic structure of a PL/SQL block. |
|
|
A standard PL/SQL code segment is called a block.
Block structure
Unlike SQL, PL/SQL allows logical grouping of a set of statements that can be sent to the Oracle database as a single block. Conceptually, a block can consist of three parts, or sections:
Block usage
Exceptions raised during execution can be dealt with in the exception handling section. A single exception handler is processed before the PL/SQL block is exited. Each block can contain nested blocks. You will learn about nested blocks in the next lesson. Typically, a PL/SQL block must contain
DECLARE, BEGIN, and END keywords. However, it may also include
EXCEPTION keywords, where you can handle any exceptions for your block. Use the following SlideShow to see the order in which
these sections appear within a block.
Building pl sql block In the next lesson, you will learn about nested blocks. |
||
|
|
||