Controlstatements in PLSQL
Controlstatements in PLSQL
1. If statement
if statments:
* It is branching statement to control flow of execution.
* it has three forms
1.if then .. end if;
2.if then else end if
3. if then elsif then end if;
syn:
if condition then
statements;
elsif condition then
statements;
elsif condition then
statements;
else
statements;
end if;
ex:
declare
a number;
b number;
c number;
begin
a:=&a;
b:=&b;
c:=&c;
if a>b and a>c then
dbms_output.put_line('a is big');
elsif b>c then
dbms_output.put_line('b is big');
else
dbms_output.put_line('c is big');
end if;
end;