Sunday 31 March 2013

Introduction to PLSQL


Advantages of PL/SQL:
---------------------

PL/SQL is a completely portable, high-performance transaction processing language
 that offers the following advantages:

Support for SQL
Support for object-oriented programming
Better performance
Higher productivity
Full portability
Tight integration with Oracle
Tight security


Better Performance:
------------------
Without PL/SQL, Oracle must process SQL statements one at a time.
Each SQL statement results in another call to Oracle and higher performance overhead.
 In a networked environment, the overhead can become significant. Every time a SQL statement is issued,
 it must be sent over the network, creating more traffic.

However, with PL/SQL, an entire block of statements can be sent to Oracle at one time.
This can drastically reduce communication between your application and Oracle.
PL/SQL stored procedures are compiled once and stored in executable form, so procedure calls are quick and efficient.

Higher Productivity:
-------------------
PL/SQL adds functionality to non-procedural tools such as Oracle Forms and Oracle Reports.
With PL/SQL in these tools, you can use familiar procedural constructs to build applications

Full Portability:
----------------
Applications written in PL/SQL are portable to any operating system and platform on which Oracle runs.
 In other words, PL/SQL programs can run anywhere Oracle can run;

PL/SQL features:


 PL/SQL is an extension of SQL
 It is an application development language containing procedural statements and commands along with SQL commands.
It bridges the gap between database technology and procedural programming languages
It allows you to process data using flow control statements like iterative loops and conditional branching.
Uses procedural techniques of control, looping and branching.
Supports SQL i.e. cursor operations, exceptions, functions and transactional commands
Variables and constants, robust error handling and functions.
Adds functionality to non-procedural tools such as SQL*Forms.
Developers using SQL*Forms can enter an entire PL/SQL block using a single trigger.

Structure of PL/SQL:


Standard PL/SQL code segment is called a Block
A block consists of three parts or sections
      Declaration Part
      Executable Part
      Exception Handling Part


Declaration Part
      optional part where variables  are defined
 Executable Part
      mandatory part which consists of executable statements
 Exception Handling Part
      optional part which consists of code for handling errors (run time).


Ur's
AmarAlam

1 comments:

Ajay Raj said...

Nice post...

Red Hat Linux Training in Chennai

Post a Comment