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.
Building AI Governance Guardrails Before You Scale
Rashan Dixon
September 13, 2026
8:00 AM
Desktop CNC Is Finally Becoming Approachable
Joe Rothwell
September 12, 2026
1:08 PM
Why Retrieval Augmented Generation Matters for Trustworthy Business AI
Rashan Dixon
September 12, 2026
8:00 AM
MIT Tool Forecasts Plausible Extreme Weather
Deanna Ritchie
September 11, 2026
5:10 PM
Meta Launches AI Assistant Amid Privacy Concerns
Rashan Dixon
September 11, 2026
3:26 PM
Three Men Face Trial Over Ensenada Deaths
Steve Gickling
September 11, 2026
2:39 PM
New York Lawmaker Pushes AI Oversight
Steve Gickling
September 11, 2026
1:11 PM
Bond Market’s $160 Trillion Reach Explained
Rashan Dixon
September 11, 2026
1:03 PM
AI Demand Pushes Gadget Prices Higher
Sumit Kumar
September 11, 2026
12:23 PM
What Microsoft’s Tier-1 Rust Status Means for Your Team in 2026
Priya Nandakumar
September 11, 2026
12:15 PM
Blank Street Raises $105 Million for Expansion
Sumit Kumar
September 11, 2026
12:10 PM
Prompt Engineering for Teams: A Practical Guide to Better AI Output
Rashan Dixon
September 11, 2026
8:00 AM
AI’s Blind Spot Makes AGI Claims Premature
Joe Rothwell
September 11, 2026
7:43 AM
Windows Security Teams Face Busy Summer
Deanna Ritchie
September 10, 2026
3:15 PM
How Developers Build IT Infrastructure for Compliance in Financial ServicesÂ
Marcus Whitfield
September 10, 2026
3:01 PM
New Findings Probe Parasite Drug Resistance
Steve Gickling
September 10, 2026
2:17 PM
5 Strategies to Reduce Enterprise Operational Expenses
Marcus Whitfield
September 10, 2026
2:15 PM
US Backs OpenAI’s AI Fair Use Claim
Rashan Dixon
September 10, 2026
1:38 PM
AI Agents Test Corporate Software Defenses
Steve Gickling
September 10, 2026
12:08 PM
Metaplanet Takes Bitcoin Strategy to U.S.
Sumit Kumar
September 10, 2026
10:28 AM
Xbox Links New Limits to Cloud Costs
Sumit Kumar
September 10, 2026
10:27 AM
AI Shopping Tools May Increase Spending
Rashan Dixon
September 10, 2026
10:24 AM
Gene-Edited Pig Kidneys Target Donor Shortage
Kirstie Sands
September 10, 2026
9:42 AM
MLOps Explained: Getting Machine Learning Into Production
Rashan Dixon
September 10, 2026
8:00 AM
Trade Measures Put Tennessee Chip Factory at Risk
Sumit Kumar
September 9, 2026
4:02 PM






















