Tuesday, 20 March 2012

What is PL/SQL programming?

PL/SQL stands for Procedural Language extensions to the Structured Query Language. As we all know SQL is a standard language which supports querying and updating the database. However, SQL lacks the capability to provide procedural language support, like C and other procedural language, to its users.

Seeing the limitations of SQL, Oracle came up with the concept of PL/SQL which provides a complete programming solution to its users. Some of the features of PL/SQL are

a) It is a highly structured language, same as any other procedural language.

b) It follows the concept of "Write once, run anywhere", i.e programs written in PL/SQL can be run in any version of Oracle database on any machine. Infact, Oracle introduced the concept of "write once run anywhere" long before Java appeared.

c) It is tightly integrated with SQL. SQL query can be used seamlessly inside PL/SQL which makes it very flexible.

d) You can call PL/SQL program from other languages(C, C++, Java ....).

Structure of a PL/SQL program

Header- Header is used in case of named blocks so that program could be called or used by some name. In case of anonymous block header is irrelevant.

Declaration- This section can be used to declare variables local to your program. In PL/SQL, variables can be declared inside this section only.

Execution- This section contains the programming logic. All the looping and conditional structures can be used inside this block.

Exception- This section catches the exception raised in execution section. You can use this section to handle the exceptions.


For more information visit

No comments:

Post a Comment