plsql_overview_1.htm |
Oracle also provides Java Virtual Machine (JVM) as part of database. This enables oracle to run java programs. In fact, starting from Oracle8 and onwards, oracle can run programs written either in PL/SQL or Java. |
Non-Procedural |
SQL : Structure Query Language (SQL), sends one line command to a DBMS. SQL is a declarative language, it renders the user to write queries and presents to the db for execution. It can't execute procedural code with iterative-loops, conditional (if-else-case logics) and sequential (GO TO, ERROR CATCHING, NULL) statements. The power of SQL is immense, it can fetch almost everything and can handle complex data formatting.
|
Procedural |
PL/SQL : oracle
It is an application developed in combination with SQL and a Procedural language and, supports object oriented encapsulation. PSQL (PL/pgSQL) : PSQL is provided by POSTGRESQL DB, for the same purpose to overcome the limits of SQL, but has it's own flavor. For example, the packages of Oracle-PL/SQL, is managed by schemas, functions in PSQL are written as string laterals, RETURN key of Oracle stands as RETURNS in PSQL, thee is no pragma like" PRAGMA AUTONOMOUS_TRANSACTION, and none the less in using delimiters. Since PSQL can be written in other languages, YOU NEED TO MENTION the name of the language at the end. |
Nut-Bolts of ORACLE:PLSQL |
SQL * Plus (oracle): Client software by Oracle corporation supporting SQL and PL/SQL . |
![]()
|
FYI PL/SQL : |
|
PL/SQL as procedural language :
It is a procedural language strongly integrated with SQL. PL/SQL is Oracle’s procedural language extension to SQL, supporting both static and dynamic SQL, meaning Static SQL supports DML and transaction control, and dynamic SQL allows DDL embedding, with in a PL/SQL block. PL/SQL allows you to mix SQL statements with procedural statements like IF statement, Looping structures etc. PL/SQL program units are generally categorized as follows:
|
PL/SQL is a block structure:
PL/SQL engine processes all procedural statements of a PL/SQL of the block and retain in memory block, but sends SQL command to SQL statements executor in the Oracle RDBMS. That means PL/SQL separates SQL commands from PL/SQL commands and executes PL/SQL commands using Procedural statement executor, which is a part of PL/SQL engine. |
PL/SQL Features :
|
PL/SQL Program Units:
|
Ref: packages |
ORACLE-Packages:
A package is a PL/SQL unit that consists of related subprograms and the explicit cursors and variables that they use. Oracle recommends that you put your subprograms into packages. Some of the reasons are:
Note: Oracle Database supplies many PL/SQL packages to extend database functionality and provide PL/SQL access to SQL features. You can use the supplied packages when creating your applications or for ideas in creating your own stored procedures. For information about these packages
|
Standalone Procedure at schema level |
![]()
|
A function within PL/SQL Block.
|