Home » SQL & PL/SQL » SQL & PL/SQL » Copying data
Copying data [message #9049] Wed, 15 October 2003 09:15 Go to next message
Nacbou
Messages: 3
Registered: October 2003
Junior Member
I want to transfer a big amount of data from one table to another table (different structure)

Using :
Insert into tbl1(a1,a2,a3)
Select b1,b2,b3 from tbl2

I tried the following insert but it takes me more then 50 mn to execute.

Insert into tbl1(a1,a2,a3)
Select b1,b2,b3 from tbl2
where not exist ....

I also tried to use the concept of unique constraint combined with "DUP_VAL_ON_INDEX" exception.
The script is running successfully but the non-existing data are not transfered


EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
DBMS_OUTPUT_LINE('Message');

I'm looking for a solution to be executed in less time
which avoid copying duplicates

Thinks to help me.
Re: Copying data [message #9051 is a reply to message #9049] Wed, 15 October 2003 10:19 Go to previous message
sverch
Messages: 582
Registered: December 2000
Senior Member
Please supply us with details (table structure, indexes), where do you expect dupes etc...
Previous Topic: Copying data from one schema to another
Next Topic: The difference between left join and right join
Goto Forum:
  


Current Time: Fri Apr 26 03:41:17 CDT 2024