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: anyone way to use a wildcard in a decode?

Re: anyone way to use a wildcard in a decode?

From: Ryan Gaffuri <rgaffuri_at_cox.net>
Date: 12 Jun 2003 04:36:17 -0700
Message-ID: <1efdad5b.0306120336.45770e9e@posting.google.com>


thanks

select decode(instr(y,'A'),0,'BLAH','XXXX') from xx;

I dont quite follow the syntax. Why is there a '0'? Also I would think that 'XXXX' would be the 'else' and the 'BLAH' would be the then.

So if pattern 'A' exists then 'BLAH' else 'XXXX', but it seems to be the other way around?

wizofoz2k_at_yahoo.com.au (Nuno Souto) wrote in message news:<73e20c6c.0306111954.718358ae_at_posting.google.com>...
> rgaffuri_at_cox.net (Ryan Gaffuri) wrote in message news:<1efdad5b.0306111155.78871856_at_posting.google.com>...
> >
> > ME>select decode(y,'%A%','XXXXX') from xx;
> >
> >
> > DECOD
> > -----
> >
> >
> > 1 row selected.
> >
> > ME>select decode(y,'%A%','XXXXX','BLAH') from xx
> > MASTER_TEST2_at_BOBAIRD>/
> >
> > DECOD
> > -----
> > BLAH
>
>
> Would:
> select decode(instr(y,'A'),0,'BLAH','XXXX') from xx;
> do what you looking for? Or vicky-the-versa on the
> decode result strings?
>
>
> Cheers
> Nuno Souto
> wizofoz2k_at_yahoo.com.au.nospam
Received on Thu Jun 12 2003 - 06:36:17 CDT

Original text of this message

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