PL/SQL is oracle’s procedural language extension to SQL. PL/SQL allows you to mix SQL statements with procedural statements like IF statements. Looping structure etc, PL/SQL is the superset of SQL. It uses SQL for data retrieval and manipulation and uses its own statement for data processing.
Pl/SQL program units are generally categorized as follows −
This is a PL/SQL block that appears within your application. In many applications PL/SQL blocks can appear where SQL statements can appear. Such blocks are called Anonymous blocks.
This is a PL/SQL block that is stored in the database with a name. Application programs are executing these procedures using the name. Oracle allows you to create functions, which are the same as procedures but return a value, and packages, which are a collection of procedures and functions.
Every PL/SQL block is first executed by the PL/SQL engine. This is the engine that compiles and executes Pl/SQL blocks.
PL/SQL engine is available in oracle server and certain oracle tools such as oracle forms and oracle reports. It executes all procedural statements of a PL/SQL of the block, but sends SQL commands to SQL statement executors in the oracle RDBMS.
That means PL/SQL separates SQL commands from PL/SQL commands and executes PL/SQL commands using procedural statement executor, which is a part of the PL/SQL engine.