Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Division by zero: how to handle?

Division by zero: how to handle?

From: Norman Dunbar <Norman.Dunbar_at_lfs.co.uk>
Date: Wed, 4 Jun 2003 16:24:27 +0100
Message-ID: <E2F6A70FE45242488C865C3BC1245DA703BED690@lnewton.leeds.lfs.co.uk>


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

SQL>
SQL> select 1/1 from dual;

       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;


'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 -------------------------------------
Received on Wed Jun 04 2003 - 10:24:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US