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: Can you use a decode with the SET clause of UPDATE statement

Re: Can you use a decode with the SET clause of UPDATE statement

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Mon, 2 Aug 2004 16:05:46 +0200
Message-ID: <410e49bd$0$25067$626a14ce@news.free.fr>

"Roy Munson" <mtproc_at_yahoo.co.uk> a écrit dans le message de news:853055e7.0408020558.33b4712e_at_posting.google.com...
> Each,
>
> Can you use a decode like so....
>
> update table
> set decode(field_a, value_1, field_b, field_c) = value_2;
>
> Compiler says not....wanting to update either field_b or field_c
> depending on the value of field_a.
>
> What say you?
>
> TIA
>
> Roy

Something like:

update table set
field_b=decode(field_a,value_1,value_2,field_b), field_c=decode(field_a,value_1,field_c,value_2) /

--
Regards
Michel Cadot
Received on Mon Aug 02 2004 - 09:05:46 CDT

Original text of this message

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