Mega Code Archive

 
Categories / Oracle PLSQL / PL SQL
 

An if-then-elsif-then-else statement where the first two comparisons are true and the third false

SQL> SQL> DECLARE   2    equal BOOLEAN NOT NULL := TRUE;   3  BEGIN   4    IF 1 = 1 THEN   5      dbms_output.put_line('Condition one met!');   6    ELSIF equal THEN   7      dbms_output.put_line('Condition two met!');   8    ELSIF 1 = 2 THEN   9      dbms_output.put_line('Condition three met!');  10    END IF;  11  END;  12  / Condition one met! PL/SQL procedure successfully completed.