Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I m trying to copy data from one table in oracle to another
both tables have different column names
i take data in dataset from one table and insert in another table
there are 28000 records
it takes 6 minutes to load
this much time not allowed
how can i minimize this time?
Posted
Updated 13-Jul-11 3:09am
v2

Write a (parameterised if needed) stored procedure to perform a set based insert and call the sp rather than loading the data and doing a one row at a time insert;

INSERT INTO A
(
    COLUMN_A
    ,COLUMN_B
    ,COLUMN_C
    ,COLUMN_D
)
SELECT
    COLUMN_W
    ,COLUMN_X
    ,COLUMN_Y
    ,COLUMN_Z
FROM
    B
WHERE
    B.COLUMN_Z = @MyParameter;
 
Share this answer
 
Comments
Kim Togo 13-Jul-11 11:37am    
Good call. My 5.
It depends on the number of columns, the data type of the columns and the size of data in each row. But generally, if you have defined indexes in your target table, disable the indexes, insert the rows and then re-enable the indexes. During bulk updates, indexes are updated which adds to the overhead.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900