# IF-THEN-ELSE Statement
# IF-THEN
DECLARE
v_num1 NUMBER(10);
v_num2 NUMBER(10);
BEGIN
v_num1 := 2;
v_num2 := 1;
IF v_num1 > v_num2 THEN
dbms_output.put_line('v_num1 is bigger than v_num2');
END IF;
END;
# IF-THEN-ELSE
DECLARE
v_num1 NUMBER(10);
v_num2 NUMBER(10);
BEGIN
v_num1 := 2;
v_num2 := 10;
IF v_num1 > v_num2 THEN
dbms_output.put_line('v_num1 is bigger than v_num2');
ELSE
dbms_output.put_line('v_num1 is NOT bigger than v_num2');
END IF;
END;
# IF-THEN-ELSIF-ELSE
DECLARE
v_num1 NUMBER(10);
v_num2 NUMBER(10);
BEGIN
v_num1 := 2;
v_num2 := 2;
IF v_num1 > v_num2 THEN
dbms_output.put_line('v_num1 is bigger than v_num2');
ELSIF v_num1 < v_num2 THEN
dbms_output.put_line('v_num1 is NOT bigger than v_num2');
ELSE
dbms_output.put_line('v_num1 is EQUAL to v_num2');
END IF;
END;