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: Division by zero: how to handle?

Re: Division by zero: how to handle?

From: Tim Ashman <tim_mapson_at_ashmans.net>
Date: Wed, 04 Jun 2003 14:59:03 GMT
Message-ID: <XOnDa.67860$M01.40727@sccrnsc02>


I would look at the decode or case statement. They are both a form of inline IF statements and you should be able to handle this problem using them.

something like

select decode(nvl(a),0,0, a/b) "MYVALUE" from ....

Georg Scholz wrote:

> Dear all,
>
> This might look like a simple question, but I didn't find a clue in the
> manuals:
>
> Is there a way to handle divisions by zero?
>
> SELECT a / b FROM ...
>

...
>
> Any hint is highly appreciated
> Thank you
> Georg Scholz
> ---
> www.scholz-informatik.at
Received on Wed Jun 04 2003 - 09:59:03 CDT

Original text of this message

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