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!

Loop insert into a table in batch of 10,000 records

antobayMay 23 2019 — edited Jun 1 2019

Hi there, please I will appreciate if anyone can advice on how to do a loop insert into a table in batches of say 10,000 records.

The reason for this is that I tried to create a copy of an existing table using CTAS but I ran into trouble doing this because this table is larger with almost 9 million records including 6 CLOB columns (some of the CLOB  columns hold 34,000 characters) thereby getting "ORA-01652: unable to extend temp segment by 128 in tablespace"

I haven't got the privilege to extend tablespace so I created the new table as CTAS where 1=2 with the aim of inserting the records. The insert into the new table runs for ever and I had to kill it. therefore I thought it might be a good idea to do a small insert in batch of 10,000 records at a time.

I am running Oracle 12c on Windows 10. SQL Developer  Version 17.3.1.279

Many thanks.

This post has been answered by Mustafa KALAYCI on May 23 2019
Jump to Answer
Comments
Post Details
Added on May 23 2019
21 comments
10,833 views