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

Re: many updates

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Sat, 22 Feb 2003 11:25:05 -0800
Message-ID: <3E57CE91.81CE10B2@exesolutions.com>


John wrote:

> Sure, you can do this:
>
> 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'
>
> John
>
> "charlie cs" <cs3526(no-spam)@yahoo.com> wrote in message
> news:%yC5a.4661$_J5.1250_at_nwrddc01.gnilink.net...
> > 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.
> >
> >

But drop the word "table" from all of the examples if you want to SQL to execute. They should all be:

UPDATE test
SET ... Daniel Morgan Received on Sat Feb 22 2003 - 13:25:05 CST

Original text of this message

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