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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Query capture

Re: Query capture

From: stephen booth <stephenbooth.uk_at_gmail.com>
Date: Thu, 7 Apr 2005 19:46:28 +0100
Message-ID: <687bf9c40504071146194a1da1@mail.gmail.com>


On Apr 7, 2005 7:08 PM, Wolfgang Breitling <breitliw_at_centrexcc.com> wrote:
> Yes, I was wondering about that. I always use
> "elapsed_time/greatest(executions,1)" to avoid division by zero problems.
>
>
> Mohammad Rafiq wrote:
>
> > Stephen
> >
> > Are you sure it ran successfully? I got error on a 9206 database on W2000.
> > Regards
> > and (a.elapsed_time/(1000000*a.executions)) > 5
> > *
> > ERROR at line 9:
> > ORA-01476: divisor is equal to zero

I ran it on 9206 on Solaris. That error is basically saying that a.executions=0. Thing is the preceding part of the where clause is a.executions>0 so there should be no way a.executions=0. The only thing that comes to mind is that Oracle is trying to evaluate the "(a.elapsed_time/(1000000*a.executions)) > 5" before the "a.executions
> 0".

You could change it to and
(a.elapsed_time/(1000000*greatest(a.executions,1))) > 5 but that shouldn't be necessary.

I'm home now and don't have access to an Oracle server but I'll test it again in the morning.

Stephen

-- 
It's better to ask a silly question than to make a silly assumption.
--
http://www.freelists.org/webpage/oracle-l
Received on Thu Apr 07 2005 - 14:51:54 CDT

Original text of this message

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