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: ERROR divisor is equal to zero

Re: ERROR divisor is equal to zero

From: gazzag <gareth_at_jamms.org>
Date: 30 Mar 2007 03:37:45 -0700
Message-ID: <1175251065.376321.295030@p15g2000hsd.googlegroups.com>


On 30 Mar, 07:27, paulhux..._at_hotmail.com wrote:
> INSERT INTO table2
> (
> SELECT aa,bb,cc,
> bb / package1.function1 (cc,dd )
> FROM table2
> where aa = 5
> )
> -- ERROR
>
> -- ORA-01476: divisor is equal to zero
>
> -- package1.function1 (cc,dd ) is a very expensive function
> (time wise)
> -- and I could also put it in the where clause but it will
> double the time.
> -- I could put it in a case statement in the select
> -- but that is the same problem
>
> -- is there a way of checking the result of
> package1.function1()
> -- and excluding it from the select statement without
> retrieving it twice.

Checkout the DECODE function:

http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/functions040.htm#i1017437

HTH -g Received on Fri Mar 30 2007 - 05:37:45 CDT

Original text of this message

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