PL/SQL can be run as an interpreted language.
You can send messages and get responses via the database connection.
PL/SQL uses procedural code blocks.
These blocks contain commands and sets of commands, which can be named or anonymous.
Here is an anonymous code block..
<<MAIN>> declare ... Declaration section ... begin ... Procedural section ... exception ... Exception handler ... end;
Anonymous blocks can be nested in as many levels as you want:
<<MAIN>> declare ... Declaration section ... begin ... Procedural section ... <<SUB1>> declare ... begin ... end; ... exception ... end;
Oracle doesn't process PL/SQL code line by line.
It handles whole messages at one time.
The root anonymous block containing all sub-elements is one logical unit.
All references and errors are analyzed in the context of that unit.
You can label all blocks including nested ones by using identifiers enclosed in << >>.
This notation allows programmers to reference elements of different blocks.