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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Decode() function fails in 8.1.5/Linux

Re: Decode() function fails in 8.1.5/Linux

From: Yosi Greenfield <ygreenfield_at_compuserve.com>
Date: Wed, 03 Nov 1999 09:01:09 -0500
Message-ID: <38204025.29BE7A62@compuserve.com>


One idea, maybe? - replace your double quotes around "foo" with single quotes. Unless foo is a column name and that's what you want.

fumi wrote:

> Kevin O'Gorman <kevin_at_trixie.kosman.via.ayuda.com> wrote in message
> news:381F2EE3.6E77C408_at_trixie.kosman.via.ayuda.com...
> > I'm running 8.1.5 (8i) Enterprise Edition on RedHat Linux, and trying
> > to execute some of the queries from the TPC-D benchmark suite (for
> > research).
> >
> > Infortunately, all of the queries with the decode() function in the
> > select list fail. They all take the default value no matter what the
> > other inputs are, it seems.
> >
> > The pattern is
> > select
> > decode(gb_attribute, "foo", expr, 0)
> > from
> > <some tables>
> > where
> > <some conditions>
> > group by
> > gb_attribute,
> > <and possibly some others>
> >
> > Now it does seem that this should work: the group-by attribute
> > is available, and constant per output row. However, the result
> > is always zero.
> >
> > Any clues out there? Any confirmation that this happens elsewhere?
>
> Hi,
> No one can tell you waht's wrong without knowing the real case.
>
> You said, the decode() function always returns the default value.
> Does the following query always returns 0?
>
> select decode(1, 1, 1, 0) from dual;
>
> The only case I can guess is caused by the error of arithemtic.
> For example,
>
> select decode(1/(1/3), 1, 1, 0) from dual;
>
> Theoretically, the result is 1,
> but realistically, it is 0.
Received on Wed Nov 03 1999 - 08:01:09 CST

Original text of this message

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