Sunday, June 22, 2014

What is PL/SQL?

SQL lacks the qualities of a structured programming language, for example conditional ( if-then-else ), looping ( for, while ) and logical statements, which are present in other famous languages like C, C++, Java etc. Though CASE and DECODE statements allows to add some level of conditional feel to the SQL statements but are not enough to tackle real life problems which require more complex logical operations.

To overcome the shortcomings of SQL, PL/SQL was introduced.



PL/SQL is Oracle’s Procedural Language extension to SQL and the RDBMS. It is a combination of SQL along with the procedural features of programming languages and it enhances the capabilities of SQL by injecting the procedural constructs to SQL, such as encapsulation, function overloading, information hiding, block structure, conditional statements, loop statements, variable types, structured data and customized error handling, the PL/SQL language takes on characteristics of object-oriented programming languages. Moreover it can be stored in the database for future reuse. It is loosely based on Ada (a variant of Pascal developed for the US Dept of Defense). PL/SQL was first released in 1992 as an optional extension to Oracle 6.

Note: 
1. PL/SQL is an extension of SQL does not mean it's an upgraded version of SQL or it cannot exist without SQL. PL/SQL is a programming language in its own right; it has its own syntax, its own rules, and its own compiler. We can write PL/SQL programs with or without any SQL statements.

2. PL/SQL is a characteristics of RDBMS, so here we have another difference between a DBMS and an RDBMS. 

No comments:

Post a Comment