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: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 07 May 2007 08:44:49 -0700
Message-ID: <1178552689.498836@bubbleator.drizzle.com>


valigula wrote:
> 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

No version and no idea what you are actually doing but look at the MERGE command.

www.psoug.org
click on Morgan's Library
Scroll down to MERGE

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Mon May 07 2007 - 10:44:49 CDT

Original text of this message

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