Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: HELP- How to ignore Divide by Zero error in database
Mario King wrote:
> Hi,
>
> User's SQL script generated "ORA-01476: divisor is equal to zero".
> How to make database to ignore this error and script to continue?
>
> Thanks in advance.
>
> MK
In addition to Davide and Bricklen's suggestions:
DECLARE
z NUMBER := 0;
x NUMBER;
BEGIN
x := 3 / z;
EXCEPTION
WHEN ZERO_DIVIDE THEN
NULL;
END dbz_exception;
/
also works.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace 'x' with 'u' to respond)Received on Sat Nov 06 2004 - 07:05:26 CST
![]() |
![]() |