From its birth SQL lacks the procedural processing like other languages have. And the need was felt that if some way these capabilities can be added to SQL then it will be more useful then it is without them. PL/SQL is nothing but Oracle’s answer for that. If you belong to Oracle world then the learning of this language can benefit you more then you can think. Because it is used in all the development tools of Oracle and also you can use it against the Oracle Server as well. Well benefits aside I am going to talk about the PL/SQL engine and how it works.
PL/SQL is present there where PL/SQL is. Suppose you are working on Forms Developer product of Oracle then let us see how a PL/SQL procedure is compiled. The PL/SQL engine breaks the procedure in three different types of blocks of statements. All the statements that consist of procedural constructs like IF, For Loop etc are processed by Procedural Statement Executor in the Forms Developer itself. All the SQL statements are sent to the Database’s SQL Statement Executor. And all the PL/SQL statements stored in the database are sent to process in the Oracle Server’s Procedural Statement Executor. The net result is combined and is sent back to the user or caller function.