Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: 2 scripts in one, possible???

Re: 2 scripts in one, possible???

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Mon, 7 May 2007 16:32:38 +0200
Message-ID: <463f3884$0$19689$426a74cc@news.free.fr>

"valigula" <valigula_at_gmail.com> a écrit dans le message de news: 1178548090.183737.13880_at_e51g2000hsg.googlegroups.com... Hi

update table1 r set
(c1, c2, c3, c4,

            c5, c6, c7)=
 ( SELECT c1, c2, c3, c4,

            c5, c6, c7
 from table2 i
 where i.c8 =c8)

I´m doing an insert first to load the pk (c8) into table1 (that is the pk for table1).
table2 has not pk so there are many c8.
I was wondering if is possible to do both scripts in one go?

Thanks in advance ...

A


Use MERGE.

Regards
Michel Cadot Received on Mon May 07 2007 - 09:32:38 CDT

Original text of this message

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