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: http://www.webyourcompany.com <xzhang88_at_hotmail.com>
Date: 11 Jun 2003 21:20:15 -0700
Message-ID: <2f50b64b.0306112020.783785cd@posting.google.com>


SQL> create table xx(y varchar2(20));

Table created.

SQL> insert into xx values('ABCD');

1 row created.

SQL> select case when y like '%A%' then 'XXXX' else 'BLAH' end FROM xx;

CASE



XXXX SQL> select decode(y,'%A%','XXXXX','BLAH') from xx   2 /

DECOD



BLAH HTH,
http://www.webyourcompany.com

rgaffuri_at_cox.net (Ryan Gaffuri) wrote in message news:<1efdad5b.0306111155.78871856_at_posting.google.com>...
> If I can manage this, I can condense about 10 insert statements into
> one and save alot of processing time.
>
> anyway to do this with a straight decode?
>
> ME>create table xx(y varchar2(20));
>
> Table created.
>
> ME>insert into xx values('ABCD');
>
> 1 row created.
> ME>commit;
>
> Commit complete.
>
> 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
Received on Wed Jun 11 2003 - 23:20:15 CDT

Original text of this message

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