Everybody knows that it takes a long time to insert a large number of records into a table. To improve the speed of insertion, you can use the PL/SWL loop FORALL.
In PL/SQL, use a cursor to fetch the rows from one table and insert them into the other table.
To reduce fetching time, do a BULK COLLECT INTO:
FETCHBULK COLLECT INTOLIMIT
To insert the fetched row, use the FORALL loop.
FORALL INDX IN .. SAVE EXCEPTIONS
You can also handle Exceptions by using the SAVE EXCEPTIONS option in the FORALL loop. Here, the FORALL loop acts as a bulk insert. When it encounters an exception, it just saves it and continues with the next record.
To view the exceptions that occurred during the insert, include the following statement after the FORALL loop:
EXCEPTIONWHEN bulk_errors THENFOR indx IN 1 .. SQL%BULK_EXCEPTIONS.COUNTLOOPerrno := SQL%BULK_EXCEPTIONS(indx).ERROR_INDEX;errmsg := SQLERRM(-1 * SQL%BULK_EXCEPTIONS(indx).ERROR_CODE);END LOOP;END;
Placing the keyword SAVE EXCEPTIONS in the FORALL loop stores all the encountered exceptions in BULK_EXCEPTIONS. Thus, the FORALL loop can be used for Bulk Insert and even Exceptions can be handled in that.
NOTE: The keyword SAVE EXCEPTIONS in the FORALL loop works only in Oracle9i.
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.
Related Posts
- Embarcadero?? Delivers New 24/7 Performance Insights and Team Capabilities with DB PowerStudio?? 2016
- Comparing Two Integers
- ?????????????????? ?????????????????? ??????????????
- David Keith champions geoengineering to combat warming
- EnterpriseDB and Quru Join G-Cloud to Expand Postgres Access for Public Sector
About Our Editorial Process
At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.
See our full editorial policy.
Châtaigniers en Fleurs Heads $180M Auction
Rashan Dixon
October 2, 2026
2:46 PM
Huang Burns Joins Secondary Investments Team
Sumit Kumar
October 2, 2026
2:16 PM
Judy Wearing Explores Hair’s Hidden Signals
Rashan Dixon
October 2, 2026
12:48 PM
Microsoft’s Next Buzzword May Be “Agents”
Kirstie Sands
October 2, 2026
11:34 AM
Conservative Majority Pauses Lower-Court Decision
Sumit Kumar
October 2, 2026
10:23 AM
Gemini 4 Argon: Pricing, Benchmarks, and Cyber Defense Rollout Explained
Johannah Lopez
October 2, 2026
8:07 AM
Students Fear Work Could Train AI
Steve Gickling
October 1, 2026
4:25 PM
Judges Uphold Pentagon Action Against AI Firm
Steve Gickling
October 1, 2026
3:02 PM
Fabrix.ai Promotes Controls for Enterprise Vibe Coding
Deanna Ritchie
October 1, 2026
2:58 PM
New Cuts Cloud Xbox and Game Pass
Sumit Kumar
October 1, 2026
2:04 PM
Seattle Startup Program Adds Tokyo Power Firm
Kirstie Sands
October 1, 2026
9:26 AM
SingleSpoke Targets Small Businesses With AI
Sumit Kumar
October 1, 2026
9:13 AM
What Is GPT-6.1 Sol? OpenAI’s New Coding Model and Codex Cloud Explained
Priya Nandakumar
October 1, 2026
8:33 AM
Why Voice Is Becoming a Serious Business Interface
Isabella Rossi
September 30, 2026
4:24 PM
US and China Cut Tariffs on Goods
Deanna Ritchie
September 30, 2026
2:17 PM
Ajaib Adds Crypto and Institutional Settlement Services
Sumit Kumar
September 30, 2026
2:02 PM
China Enacts Rules for AI Relationships
Sumit Kumar
September 30, 2026
1:15 PM
Pixcut S1 Puts Sticker Printing in Focus
Kirstie Sands
September 30, 2026
1:04 PM
AI Legal Services Target Corporate Bottlenecks
Rashan Dixon
September 30, 2026
12:32 PM
How Srikumar Nayak Is Building Trustworthy AI for Modern Financial Systems
Marcus Whitfield
September 30, 2026
11:17 AM
Claude Sonnet 5.5: Pricing, Benchmarks, and New Cyber Safeguards Explained
Johannah Lopez
September 30, 2026
8:12 AM
AI Classroom Bans Face Growing Scrutiny
Kirstie Sands
September 29, 2026
4:10 PM
Ayble Health Raises $16 Million for GI Care
Sumit Kumar
September 29, 2026
3:44 PM
Why High Paid Tech Workers Are Drowning In Debt
Priya Nandakumar
September 29, 2026
3:24 PM
Data Centres Shift From Copper to Light
Sumit Kumar
September 29, 2026
2:44 PM
























