Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Division by zero: how to handle?
Try this which works, you get the error message but the script continues
onwards :
SQL>ed fred.sql
whenever sqlerror continue none
select 1/1 from dual;
select 'ok' from dual;
select 1/0 from dual;
select 'finished' from dual;
<exit editor & save>
SQL> set lines 132 SQL> set echo on SQL> @fred SQL> whenever sqlerror continue none
1/1
1
SQL> select 'ok' from dual;
'O
-- ok SQL> select 1/0 from dual; select 1/0 from dual * ERROR at line 1: ORA-01476: divisor is equal to zero SQL> select 'finished' from dual;Received on Wed Jun 04 2003 - 10:24:27 CDT
'FINISHE
-------- finished SQL> Is this what you are after then? Cheers, Norman. ------------------------------------- Norman Dunbar Database/Unix administrator Lynx Financial Systems Ltd. mailto:Norman.Dunbar_at_LFS.co.uk Tel: 0113 289 6265 Fax: 0113 289 3146 URL: http://www.Lynx-FS.com -------------------------------------