Skip to content
Home / Introduction to PL/SQL

Introduction to PL/SQL

SQL stands for Structure Query Language. It is a programming language that is used to communicate with and manage data in a relational database. It is the most popular language for managing databases and it has been around since the 1970s.

You can easily query, modify database using the SQL. It does not have tha conditional processing, if anything else logic as such. So here Oracle PL/SQL Born.

What is PL/SQL?

PL/SQL is the procedural extension to SQL. It supports syntax, dataype and you can use SQL in PL/SQL, but it add that addition logic in it. It is highly inspired by ADA, that is reason you may find a lot of similarity between them.

It is proprietary language by Oracle and not available in any other 3rd party application.

Advantages of PL/SQL

    • Tight Integration with SQL
    • High Performance
    • High Productivity
    • Portability
    • Scalability
    • Manageability
    • Support for Object-Oriented Programming

Main Features of PL/SQL

    • Error Handling
    •  Blocks
    •  Variables and Constants
    •  Subprograms
    •  Packages
    • Triggers
    •  Input and Output
    •  Data Abstraction
    • Control Statements
    • Conditional Compilation
    • Processing a Query Result Set One Row at a Time

Architecture of PL/SQL

The PL/SQL compilation and runtime system is an engine that compiles and runs PL/SQL units.

The engine can be installed in the database or in an application development tool, such as Oracle Forms.

In either environment, the PL/SQL engine accepts as input any valid PL/SQL unit. The engine runs procedural statements, but sends SQL statements to the SQL engine in the database, as shown

When an application development tool processes PL/SQL units, it passes them to its local PL/SQL engine. If a PL/SQL unit contains no SQL statements, the local engine processes the entire PL/SQL unit. This is useful if the application development tool can benefit from conditional and iterative control.

For example, Oracle Forms applications frequently use SQL statements to test the values of field entries and do simple computations. By using PL/SQL instead of SQL, these applications can avoid calls to the database.

Basic Structure of PL/SQL program


<declarations section>


<executable command(s)>


<exception handling>



First PL/SQL Program

Print Hello Worlds program here

What PL/SQL Offers?

< Put all tha PL SQL has to offer>