PL SQL Programmig 1
PL SQL Programmig 1
PL/SQL
PROGRAMMING
PL/SQL PROGRAMMING
PL/SQL stands for "Procedural Language
/Structure Query Language”.
PL/SQL is a block structured language.
instruction.
All these instruction will be executed as a
1. Declaration section
2. Execution section
3. Exception-Handling section
1. DECLARATION SECTION
This is the first section of the PL/SQL blocks.
This is the section in which the declaration of
'DECLARE' .
2. EXECUTION SECTION
Execution part is the main and mandatory part
which actually executes the code that is written
inside it.
Since the PL/SQL expects the executable
statements from this block this cannot be an
empty block, i.e., it should have at least one valid
executable code line in it.
This can contain both PL/SQL code and SQL code.
This can contain one or many blocks inside it as
a nested block.
This section starts with the keyword 'BEGIN'.
This section should be followed either by 'END' or
Exception-Handling section (if present)
3. EXCEPTION-HANDLING
SECTION
The exception is unavoidable in the program which occurs
at run-time and to handle this Oracle has provided an
Exception-handling section in blocks.
This is an optional section of the PL/SQL blocks.
This is the section where the exception raised in the
execution block is handled.
This section is the last part of the PL/SQL block.
Control from this section can never return to the execution
block.
This section starts with the keyword 'EXCEPTION'.
This section should always be followed by the keyword
'END'.
The Keyword 'END' marks the end of PL/SQL block.
PL/SQL VARIABLES
A variable is a reserved memory area for storing
the data of a particular datatype.
This memory is reserved at the time of
used.