ZERO_DIVIDE Exception

The ZERO_DIVIDE exception happens when dividing a number by zero.


SQL> BEGIN
  2      DBMS_OUTPUT.PUT_LINE(1 / 0);
  3  EXCEPTION
  4  WHEN ZERO_DIVIDE THEN
  5   DBMS_OUTPUT.PUT_LINE('Division by zero');
  6  END;
  7  /
Division by zero

PL/SQL procedure successfully completed.

SQL>
SQL>
Home »
Oracle »
PL/SQL » 

Exceptions:
  1. Build-in Exceptions
  2. ZERO_DIVIDE Exception
  3. DUP_VAL_ON_INDEX Exception
  4. INVALID_NUMBER Exception
  5. OTHERS Exception
Related: