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 -> Update question

Update question

From: <tombest_at_firstusa.com>
Date: 1 Mar 2001 17:52:20 GMT
Message-ID: <97m28k$dm4$1@news.netmar.com>

I have a tough SQL question... the issue is performance.

I would like to update two columns of a very large (millions of rows) table from the contents
of a smaller table (100K rows). There is a primary key on each table. I tried to do this with
a view update:

update the
(select t.c1 new_c1, t.c2 new_c2,

    e.c1 old_c1, e.c2 old_c2
 from table1 t, table2 e
 where e.pk_id = t.pk_id ) view1
set view1.old_ c1 = view1.new_c1,

    view1.old_c2 = view1.new_c2;

But I get an error because I cannot select multiple columns in the view. I wrote
a stored procedure what has a cursor that walks through the smaller table and issues
updates to the large one, and that works. Is there a better (faster) way to do this?

Any help is appreciated.

Received on Thu Mar 01 2001 - 11:52:20 CST

Original text of this message

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