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: update table

Re: update table

From: Lawrence Simela <lsimela_at_mahalini.prestel.co.uk>
Date: Tue, 25 Sep 2001 01:19:01 +0100
Message-ID: <9ookv4$4qg$2@phys-ma.sol.co.uk>


This would do it:

update table1 t1

        set (field1, field2, field3...) = (select field1, field2, field3.. From table2 where key = t1.key)

You cannot use wildcard *

hth
Lawrence

"Gloria Zhao" <gloriaz_ca_at_yahoo.com> wrote in message news:fcb331b6.0109240838.52590692_at_posting.google.com...
> Hi there,
>
> Is it possible to update a table as the following in Oracle:
>
> update table1 set * = (select * from table2 where table1.key=
> table2.key);
>
> If it's inpossible doing it in sqlplus, is there any other similiar
> solutions in PL/SQL? I mean some special functions which could let us
> update all columns in table1 with the info in table1 where the the
> records in table1 and table2 have the same key.
>
> Thanks a lot in advance.
>
> Gloria
Received on Mon Sep 24 2001 - 19:19:01 CDT

Original text of this message

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