Let’s take look at of PL/SQL Block Structure
• Block is the most basic unit in PL/SQL
• Usually, PL/SQL blocks combine statements that represent a single logical task
• Different tasks are within a single program can be separated into blocks
• This makes easier to understand and maintain the logic of the program
PL/SQL Program Structure
DECLARE
Variable declarations
BEGIN
Program statements
EXCEPTION
Error-handling statements
END;
Declaring PL/SQL Variables
• PL/SQL is a strongly-typed language (it contains definitions of variables and constants)
• All variables must be declared prior to use
• Syntax for declaring a variable:
• variable_name data_type_declaration;
• Example:
• current_s_id NUMBER(6);
Leave a comment