What is PL SQL
What is PL SQL
PL/SQL stands for Procedural Language/Structured Query Language. PL/SQL offers a set of
procedural commands (IF statements, loops, assignments), organized within blocks
(explained below), that complement and extend the reach of SQL. PL/SQL is Oracle’s
extension of SQL designed for developers working with the Oracle Database.
Building blocks of PL/SQL programs
PL/SQL is a block-structured language. A PL/SQL block is defined by the keywords
DECLARE, BEGIN, EXCEPTION, and END, which break up the block into three sections:
Declarative: Statements that declare variables, constants, and other code elements, which can
then be used within that block
Executable: Statements that are run when the block is executed
Exception handling: A specially structured section you can use to “catch,” or trap, any
exceptions that are raised when the executable section runs
Only the executable section is required. You don’t have to declare anything in a block, and
you don’t have to trap exceptions raised in that block.
A block itself is an executable statement, so you can nest blocks within other blocks.
Sample Program
BEGIN
DBMS_OUTPUT.put_line ('Hello World!');
END;
/