1DECLARE
2 a number(3) := 100;
3BEGIN
4 IF ( a = 10 ) THEN
5 dbms_output.put_line('Value of a is 10' );
6 ELSIF ( a = 20 ) THEN
7 dbms_output.put_line('Value of a is 20' );
8 ELSIF ( a = 30 ) THEN
9 dbms_output.put_line('Value of a is 30' );
10 ELSE
11 dbms_output.put_line('None of the values is matching');
12 END IF;
13 dbms_output.put_line('Exact value of a is: '|| a );
14END;
15/
1IF condition1 THEN
2 {...statements to execute when condition1 is TRUE...}
3
4ELSIF condition2 THEN
5 {...statements to execute when condition1 is FALSE and condition2 is TRUE...}
6
7ELSE
8 {...statements to execute when both condition1 and condition2 are FALSE...}
9
10END IF;