Friday, 16 May 2014

using if else with logical operators in plsql


DECLARE
a boolean := true;
 b boolean := false;

 BEGIN

 IF (a AND b) THEN
 dbms_output.put_line('Line 1 - Condition is true');
 END IF;

 IF (a OR b) THEN
 dbms_output.put_line('Line 2 - Condition is true');
 END IF;

 IF (NOT a) THEN
 dbms_output.put_line('Line 3 - a is not true');
 ELSE
 dbms_output.put_line('Line 3 - a is true');
 END IF;
 
     IF (NOT b) THEN
     dbms_output.put_line('Line 4 - b is not true');
     ELSE
     dbms_output.put_line('Line 4 - b is true');
     END IF;
END;

No comments:

Post a Comment

Note: only a member of this blog may post a comment.