PL/SQL Introduction
PL/SQL Introduction
PL/SQL stands for Procedural Language extension of SQL. It is a combination of SQL and procedural features of programming languages. Oracle Corporation developed it in the early 1990s to enhance SQL’s capabilities.
Advantages of PL/SQL
Some of the advantages of PL/SQL are as follows:
- Block Structures
- Procedural Language Capability
- Performance
- Error Handling
Block Structures
PL SQL consists of blocks of code, which can be nested within each other. Each block forms a unit of a task or a logical module. PL/SQL Blocks can be stored in the database and reused.
Procedural Language Capability
PL SQL consists of procedural language constructs such as conditional statements (if else statements) and loops like (FOR loops).
Better Performance
PL SQL engine processes multiple SQL statements simultaneously as a single block, reducing network traffic.
Error Handling
PL/SQL handles errors or exceptions effectively during the execution of a PL/SQL program. Once an exception is caught, specific actions can be taken depending upon the exception type or it can be displayed to the user with a message.