Bulk Insert Performance
jwebMar 16 2012 — edited Mar 19 2012I have a loop that generates dynamic SQL Insert statements.
execute immediate 'INSERT INTO STD_IMPORTS( FULL_NAME, HOUSE_NUMBER, IMPORT_DATE ) SELECT CUSTOMER_NAME, to_number(ADDRESS_NUMBER), TRUNC(SYSDATE) FROM STAGINGS_1 LOG ERRORS INTO err$_STD_IMPORTS (''INSERT ROW'') REJECT LIMIT 5';
This statement works fine, but in my test run I insert 100,000 recrods, and this took around 12 seconds. Would this be more efficient to put the values into a bulk collection first then insert? I am a bit vague on collections, I tried using a buil collect into a table but then couldn't insert this as I got a 'not enough values' error.