Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Inserting thousand of records via execute immediate goes slow.

KdeGraafAug 31 2016 — edited Sep 13 2016

Hi all,

I need to import data from an other table that is only reachable via BI publisher.

BI publisher gives me a text file with data from a specific table and this file is saved in a temp table.

Now I'm writing a PLSQL procedure to format this file into inserts.

So I build a large string like this:

BEGIN

INSERT INTO TABLE (A,B,C) VALUES ('A','B','C');

INSERT INTO TABLE (A,B,C) VALUES ('A','B','C');

..

INSERT INTO TABLE (A,B,C) VALUES ('A','B','C');

INSERT INTO TABLE (A,B,C) VALUES ('A','B','C');

END;

The values in this insert i'm getting from the text file in the temp table.

This is then executed via 'EXECUTE IMMEDIATE';

This goes pretty slow probably because it is handled as single inserts.

I'm aware of the FORALL functionality but I don't know how to use it for this case because I don't have collection that can be used.

Please let me know how I can speed up this process. I hope there is a more efficient way to do these inserts than I do it now.

This post has been answered by AndrewSayer on Aug 31 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 29 2016
Added on Aug 31 2016
42 comments
6,171 views