PL/SQL Introduction

PL/SQL- PLSQL stands for "Procedural Language/Structured Query Language". PL SQL is closely integrated into the SQL language, yet it adds programming constructs that are not native to SQL. PL/SQL also implements basic exception handling. It supports variables, conditions, loops and arrays.Each PL/SQL program like procedures,functions, packages consists of SQL and PL/SQL statements which form a PL/SQL block.

A PL/SQL Block consists of three sections:
The Declaration section .
The Execution section .
The Exception Handling section .

These blocks are mainly bounded by 4 keyword:

  • DECLARE: DECLARE is the keyword that will specify declaration section.This is section where we will declare the data type definitions, variables, embedded functions, and procedures.
  • BEGIN: BEGIN is the keyword that marks the start of executable section. We must have at least one line of executable code, even if it’s the keyword NULL, which means no operation.
  • EXCEPTION:is the keyword where exception-handling section starts.This is where we will catch any database or PL/SQL errors orexceptions
  • END: is the keyword to mark the end of the PL/SQL block.

No comments:

Post a Comment