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: help: many updates

Re: help: many updates

From: Jaap W. van Dijk <j.w.vandijk.removethis_at_hetnet.nl>
Date: Sun, 23 Feb 2003 11:41:03 +0100
Message-ID: <hu8h5voa8ihokd5oovqisak11ddin4odo8@4ax.com>


I'm not sure why the respondents see this as such a difficult problem. The OP asks for one update statement, which IMO is

update table test
set

colA=decode(colA_1,'X','A',colA),
colB=decode(colB_1,'Y','B',colB),
colC=decode(colC_1,'Z','C',colC)

where
colA_1 = 'X' or
colB_1 = 'Y' or
colC_1 = 'Z'

Jaap.

On Sat, 22 Feb 2003 03:57:47 GMT, "charlie cs" <cs3526(no-spam)@yahoo.com> wrote:

>We are using 9.2.
>We need to update a big table like this
>
>SQL> update table test set colA='A' where colA_1='X';
>SQL> update table test set colB='B' where colB_1='Y';
>SQL> update table test set colC='C' where colC_1='Z';
>
>.....
>
>Is there any way we can do this in one sql, instead of making several
>database calls?
>
>Thanks for you help.
>
Received on Sun Feb 23 2003 - 04:41:03 CST

Original text of this message

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