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.
What Is GPT-6 Cyber? OpenAI’s New Cybersecurity AI Model Explained
Rashan Dixon
November 13, 2026
8:08 AM
What Is Microsoft’s November 2026 Patch Tuesday? Outlook Zero-Day Explained
Deanna Ritchie
November 12, 2026
8:08 AM
What Is Claude Fable 5.2? Anthropic’s New Flagship Model Explained
Steve Gickling
November 11, 2026
8:12 AM
What Is DeepSeek Super-Agent? DeepSeek’s Open Source Coding Agent Explained
Rashan Dixon
November 10, 2026
7:52 AM
What Is the Meta Conductor Acquisition? AI Coding Agents Explained
Deanna Ritchie
November 9, 2026
8:07 AM
Exploring How Service Robots Navigate Everyday Unpredictability with LiDAR
Steve Gickling
November 6, 2026
2:33 PM
What Is the Cloudflare Deno Acquisition? Explained
Editorial-team
November 6, 2026
8:18 AM
What Is FlashProve? Anthropic’s New Way to Verify AI Model Identity
Rashan Dixon
November 5, 2026
10:08 AM
What Is Recursive Self-Improvement in AI? Anthropic’s Warning Explained
Deanna Ritchie
November 4, 2026
8:05 AM
Domestic Intelligence: What Lütke, Musk And Panin Know That You Don’t?
Steve Gickling
November 3, 2026
11:32 AM
Design Systems to AI Platforms: The Evolution of Developer Experience
Rashan Dixon
November 3, 2026
10:55 AM
What Is the PHP2Shell Vulnerability? The Critical PHP RCE Flaw Explained
Steve Gickling
November 3, 2026
7:05 AM
How to Start a Private Dental Office
Rashan Dixon
November 2, 2026
3:48 PM
Best Vendor for an AI Gateway in Regulated Industries in 2026
Steve Gickling
November 2, 2026
3:30 PM
What Is the Anthropic IPO? The S-1 Filing and Ticker ANT Explained
Rashan Dixon
November 2, 2026
10:50 AM
What Is GitHub Copilot Fusion? GitHub’s New Multi-Model Coding System Explained
Deanna Ritchie
October 30, 2026
7:20 AM
What Is the Cloudflare KV Cache Leak? GLM-5.3 Bug Explained
Steve Gickling
October 29, 2026
8:13 AM
What Is the Next.js RCE Vulnerability in Image Optimization?
Rashan Dixon
October 28, 2026
1:30 PM
What Is the Node2Shell Vulnerability in Node.js?
John Rampton
October 27, 2026
8:04 AM
What Is the OpenCode Breach? Distillation Attack Explained
Deanna Ritchie
October 26, 2026
7:44 AM
What Is GitHub Copilot Computer Use? GitHub’s New Desktop Agent Explained
Rashan Dixon
October 23, 2026
8:08 AM
Choosing an Online Graduate Program: Accreditation, Flexibility, Support and What You Should Know.Â
John Rampton
October 22, 2026
3:08 PM
What Is SlugFest, the npm Trusted Publishing Vulnerability?
Deanna Ritchie
October 22, 2026
1:00 PM
What Is VS Code Agent Sandboxing? Microsoft’s New AI Agent Security Layer Explained
Steve Gickling
October 21, 2026
12:44 PM
Meta Muse Wonder: Pricing, Benchmarks, and What It Means for Developers
Rashan Dixon
October 20, 2026
7:56 AM
























