| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.oracle -> Re: Large Table Update/Merge problem
Do the update first.
update
(
select a.col1 acol1, b.col1 bcol1
from a, b
where a.key = b.key
)
set acol1 = bcol1
make sure you have unique key on the "key" columns of both tables.
Then go for the insert -
insert into b select * from a where not exists
(
select null from b where a.key = b.key
)
You may need to set statistics on the temporary tables to get an efficient plan.
(Cannot gather statistics on temporary tables)
Pratap Deshmukh
Cognizant Technology Solutions, India
Received on Wed Aug 18 2004 - 23:52:38 CDT
![]() |
![]() |