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 -> Re: Divide By zero error

Re: Divide By zero error

From: Christopher Beck <clbeck_at_us.oracle.com>
Date: Mon, 14 Feb 2000 08:46:16 -0500
Message-ID: <il1gaskrgrl8buokd9bfqkdhapnpqkl504@4ax.com>


On Mon, 14 Feb 2000 13:18:23 GMT, Parvinder Singh <parora_at_questone.com> wrote:

>Hi all
>
> Can i somehow get rid of "divide by zero error" ?
> ERROR:
> ORA-01476: divisor is equal to zero
> All i want is wherever the divisor's value comes to 0 it should give
>the result of the division as 0
>Can i somehow achieve this ?????

Look at using decode()...

select decode( b, 0, 0, a/b ) from my_table;

hope this helps.

chris.

>
>regards
>~Parvinder
>
>

--
Christopher Beck
Oracle Corporation
clbeck_at_us.oracle.com
Reston, VA.



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Mon Feb 14 2000 - 07:46:16 CST

Original text of this message

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