PL/SQL Basics – Introduction to PL/SQL Programming
PL/SQL is a database programming language which is used to modify and manipulate the database or a complete database application. PL/SQL provides support for developing Web Applications and Server Pages. PL/SQL can be both a server-side and a client-side database programming language.
PL/SQL is basically used to execute “queries” or “tasks” (in an easy way) to update or delete or modify or add data into the database.
The prerequisite for PL/SQL is SQL. But, don’t worry if you’re not well versed with SQL. Here, I shall also be giving you hints regarding SQL language and soon would be updating a complete tutorial on SQL.
PL/SQL is one of the top most ranked programming languages for handling databases. Many big companies still use this language for their database operations. So, there are many job opportunities with PL/SQL on your Resume.
The major difference between Structures Query Language(SQL) and Procedural Language/Structured Query Language(PL/SQL) is that the former is a single line or a single statement or a single query executer whereas the latter takes multiple queries at one time in the form of a “block”.
SQL executes one query at a time. It executes a single insert/update/delete query at a given time whereas PL/SQL can execute more than a single query in the form of a block. It makes use of terms such as loops, cursors, variables, etc to execute queries. We shall learn more about this in the upcoming PL/SQL tutorials.
PL/SQL optionally uses or requires grouping multiple instructions or statement in a single block and sending the entire block for execution in a single call.
A block of PL/SQL program code contains basically three sections as follows:
1. Declaration Section
2. Execution Section
3. Exception Section
These mentioned sections appear order wise in a PL/SQL Block and cannot be interchanged but can be omitted as per the needs.
Note: PL/SQL has tight integration with SQL
The Exception section of a PL/SQL Block is an optional section. This section starts with the keyword “EXCEPTION”. This section is used to handle any errors that occur during program execution. It helps normal termination of an abnormal program.
This was all about the introduction to PL/SQL programming. Let us know if you have any queries in the comment section below.