PL/SQL
|
PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation's proprietary server-based extension to the SQL database language, and emulates the Ada programming language.
Since SQL functions as a declarative language, and unlike some functional programming languages the standard does not require implementations to convert tail calls to jumps or readily provide "first row" and "rest of table" accessors, SQL cannot easily perform some constructs such as loops. PL/SQL, however, as a Turing-complete procedural language which fills in these gaps, allows Oracle database developers to interface with the underlying relational database in an imperative manner. SQL statements can make explicit in-line calls to PL/SQL functions, or can cause PL/SQL triggers to fire upon pre-defined DML events.
PL/SQL functions analogously to the embedded procedural languages for other relational databases. Sybase and its derivative Microsoft SQL Server have Transact-SQL, PostgreSQL has PL/PgSQL (which tries to emulate PL/SQL to an extent). Aside from some proprietary functions (notably Oracle's UTL_FILE
package) PL/SQL code closely resembles Transact-SQL, allowing trivial conversion if the code does not use proprietary features.
As an alternative to PL/SQL, Oracle programmers can also use methods written in Java.
References
- PL/pgSQL - SQL Procedural Language (http://www.postgresql.org/docs/8.0/interactive/plpgsql.html)
- Steven Feuerstein (2002). Oracle PL/SQL Programming, 3rd ed. O'Reilly & Associates. ISBN 0596003811.
(Many consider this book the "bible" of PL/SQL development) - Oracle PL/SQL FAQ (http://www.orafaq.com/faqplsql.htm)
Template:Major programming languages smallde:PL/SQL fr:PL/SQL ja:PL/SQL