Tutorial:

Oracle PL/SQL tutorial

SearchOracle.com

Unique to Oracle, PL/SQL is the procedural language extension to the structured query language (SQL). It combines a database language with a procedural programming language, which is built on a basic unit called a block. By compiling and storing executable blocks, Oracle can process the PL/SQL quickly and easily.

That's just a quick overview of PL/SQL -- now for the nitty-gritty. This fast guide links you to PL/SQL tips, expert responses and resources on SearchOracle.com and from around the Web. It can help both newbies and veterans become better acquainted with the language and hone their developer skills.

  TABLE OF CONTENTS
   What is PL/SQL?
   PL/SQL basics
   Language elements
   Details on Oracle datatypes
   Procedures, functions and packages
   Tips on triggers
   Working with stored procedures
   PL/SQL tuning
   Dynamic SQL in PL/SQL
   Additional PL/SQL resources

 


  What is PL/SQL?
[ Return to Table of Contents ]

The following explanation of PL/SQL is excerpted from "Learning Oracle PL/SQL" by Bill Pribyl & Steven Feuerstein.

"Structured Query Language is a language based on set theory, so it is all about manipulating sets of data. SQL consists of a relatively small number of main commands such as SELECT, INSERT, CREATE, and GRANT; in fact, each statement accomplishes what might take hundreds of lines of procedural code to accomplish. That's one reason SQL-based databases are so widely used. The big joke about the name "SQL" is that it is not really structured, is not just for queries, and (some argue) is not even a real language. Nevertheless, it's the closest thing there is to a lingua franca for relational databases such as Oracle's database server, IBM's DB2 and Microsoft's SQL Server.

"A language extension is a set of features that somehow enhance an existing language. This phrase might imply, incorrectly, that PL/SQL is a special version of SQL. That isn't the case, however. PL/SQL is a programming language in its own right; it has its own syntax, its own rules, and its own compiler. You can write PL/SQL programs with or without any SQL statements. Some authors assert that PL/SQL is a superset of SQL, but that's a bit of an overstatement, because only the most common SQL statements can be used easily in a PL/SQL program.

"PL/SQL, then, is a language that is closely related to SQL, but one that allows you to write programs as an ordered series of statements. Or, if you want a definition of PL/SQL that befits a programmer:

"PL/SQL is a procedural (Algol-like) language with support for named program units and packages; much of its syntax is borrowed from Ada, and from Oracle's SQL it derives its datatype space and many built-in functions."

See the following section for additional definitions and explanations of PL/SQL.

 


  PL/SQL basics
[ Return to Table of Contents ]

PL/SQL offers a variety of benefits to Oracle DBMS users, including the ability to modularize program development, support for error handling, portability across platforms and much more. The following resources will help newbies learn more about the benefits and uses of PL/SQL.