Index | Home | Forums
Oracle PL/SQL Example 2-23 Short-Circuit Evaluation

Example 2-23 Short-Circuit Evaluation

DECLARE
   on_hand  INTEGER := 0;
   on_order INTEGER := 100;
BEGIN
-- Does not cause divide-by-zero error; evaluation stops after first expression
   IF (on_hand = 0) OR ((on_order / on_hand) < 5) THEN
      DBMS_OUTPUT.PUT_LINE('On hand quantity is zero.');
   END IF;
END;
/


This page was generated on/at Feb 23,2008 00:20:12
General comments and questions regarding this document should be sent by email to info@oracleabc.com or post your comments here




Index | Home | Forums
Oracle PL/SQL Example 2-23 Short-Circuit Evaluation

Example 2-23 Short-Circuit Evaluation

DECLARE
   on_hand  INTEGER := 0;
   on_order INTEGER := 100;
BEGIN
-- Does not cause divide-by-zero error; evaluation stops after first expression
   IF (on_hand = 0) OR ((on_order / on_hand) < 5) THEN
      DBMS_OUTPUT.PUT_LINE('On hand quantity is zero.');
   END IF;
END;
/


This page was created by oracleabc.com on Feb 23,2008 00:09:02
General comments and questions regarding this document should be sent by email to info@oracleabc.com or post your comments here