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: opposite of oracle decode

Re: opposite of oracle decode

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 06 Oct 2005 11:21:49 -0700
Message-ID: <1128622907.243310@yasure>


Adam Sandler wrote:
> Daniel... it wasn't clear... If it was, I wouldn't have asked. In the
> first 3 posts, nobody said "use decode both ways". Yes I'm new to
> Oracle, that's why I was asking the questions. As being new to Oracle,
> I'm not necessarily 100% aware of all the built in functions Oracle
> offers. As far as lack of knowledge goes, whatever man - I hope that
> made you feel better. If you find my questions too elementary for you,
> then simply scroll past. There's really no need to flame me (or anyone
> else for that matter)... unless flaming makes you feel better, unless
> flaming helps you compensate for a lack of parental attention growing
> up or even makes you feel better about your tiny penis. It's real easy
> to be 6'6, 250 from behind the anonymity of a keyboard, but any of the
> above aren't excuses for having bad manners... how much CLEARER CAN
> THAT BE? Just scroll past tough guy.
>
> Thanks to the rest of the group for your help!!!

Then please try the following:

CREATE TABLE t (
testcol NUMBER(1));

DECLARE myvalue VARCHAR2(20) := 'ABC';

BEGIN
   INSERT INTO t
   (testcol)
   VALUES
   (DECODE(myvalue, 'ABC', 1, 2));
END;
/

SELECT * FROM t;

SELECT DECODE(testcol, 1, 'ABC', 'Not ABC') FROM t;

For more examples go to the DECODE page in Morgan's Library at www.psoug.org.

HTH

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Thu Oct 06 2005 - 13:21:49 CDT

Original text of this message

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