|
In this module, you learn how to use PL/SQL code
to enhance functionality in your application.
PL/SQL stands for Procedural Language extension
to SQL. The language offers a robust programming environment that
enables you to program procedurally and/or with object oriented programming
techniques such as encapsulation, information hiding, and function overloading.
With PL/SQL, you can use state-of-the-art programming to access the Oracle Database
server and toolset.
PL/SQL provides procedural constructs such as variables,
constants and types. The language provides selective and iterative constructs
to SQL. Following are the major benefits of using PL/SQL :
- Integration
of procedural constructs with SQL.
PL/SQL integrates control statements
and conditional statements with SQL. This gives you
a better control of SQL statements and their execution.
|
|
- Reduction
in network congestion.
PL/SQL allows you to logically combine
SQL statements as one unit. The application can send
the entire block to the database instead of sending
the SQL statements one at a time. This reduces the network
traffic.
|
|
- Modularized
program development.
PL/SQL allows you to group logically
related statements within blocks. You can nest blocks
inside larger blocks to build powerful programs. Also,
you can break your application into smaller modules.
|
|
- Integration
with tools.
The PL/SQL engine is integrated in
Oracle tools such as SQL Developer, HTML DB, Oracle Database XE, Oracle
Forms, Oracle Reports and so on. When you use these
tools, the locally available PL/SQL engine processes
the procedural statements and only the SQL statements
are passed to the database.
|
|
- Portability.
PL/SQL programs can run
anywhere Oracle server runs irrespective of the operating
system and the platform. You do not need to tailor them
to each new environment.
|
|
- Exception
handling.
An exception is an error in PL/SQL
that is raised during the execution of a block of code. PL/SQL
allows you to handle exceptions efficiently. You can
define separate blocks for dealing with exceptions.
|
|
You may find it necessary to use database applications
that include programming logic, sequential statements, and SQL statements.
Using PL/SQL, you can build applications that are resilient to change
over time and scale to large user populations.
|