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: Copy row and alter a column

Re: Copy row and alter a column

From: DI Karl Heinz Hörmann <kh.hoermann_at_penta.at>
Date: Tue, 25 Jan 2000 05:31:48 +0100
Message-ID: <86j8lq$6a1$1@newsmaster01.magnet.at>

jeanch_at_my-deja.com schrieb in Nachricht <864mfu$8rn$1_at_nnrp1.deja.com>...

>INSERT INTO tab SELECT * FROM tab WHERE EID = 41
>
>"AND"
>UPDATE tab set state = 2 where eid = 41 and rownum = 1;

suppose tab is defined as (c1, c2, c3, state, c4, ... cn) - USE:

insert into tab (eid, c1, c2, c3, state, c4, ... cn) select eid, c1, c2, c3, 2, c4, ... cn
from tab
where eid = 41

    and .... (*)

MIND:
a) the primary key consists of eid + .... (*) ? ! - perhaps state ? b) the additional primary key column condition goes into .... (*)

regards Received on Mon Jan 24 2000 - 22:31:48 CST

Original text of this message

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