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.
Investors Bet Big On AI Returns
Steve Gickling
August 5, 2026
1:51 PM
Creators Tackle Smartphone Self-Recording
Rashan Dixon
August 5, 2026
12:32 PM
OpenAI Probes New Agent Misbehavior
Sumit Kumar
August 5, 2026
10:25 AM
Americans Weigh AI Data Centers Expansion
Kirstie Sands
August 5, 2026
10:07 AM
Startup Targets Low-Cost AI Brain Scans
Steve Gickling
August 5, 2026
9:27 AM
Anthropic Debuts Claude Opus 5 At Lower Cost
Rashan Dixon
August 5, 2026
9:23 AM
Pentagon Turns To Startups To Rebuild Stockpiles
Deanna Ritchie
August 5, 2026
9:22 AM
Practical AI Agents in Healthcare That Actually Work
Rashan Dixon
August 5, 2026
8:00 AM
Eight Form Exits Project After Backlash
Deanna Ritchie
August 4, 2026
4:49 PM
Expert Warns Activism Weakens West in AI Race
Steve Gickling
August 4, 2026
3:55 PM
Nest Boosts VC Allocation to £200 Million
Sumit Kumar
August 4, 2026
3:22 PM
MIT Launches JARVIS AI Engineering Challenge
Sumit Kumar
August 4, 2026
3:12 PM
Can Fauci Face Prison? Legal Reality
Rashan Dixon
August 4, 2026
2:22 PM
New iPhone Feature Eases Wireless Transfers
Rashan Dixon
August 4, 2026
1:54 PM
Ozlo Updates Sleep Earbuds After Bose Exit
Kirstie Sands
August 4, 2026
9:52 AM
Chinese AI Researchers Turn To X
Steve Gickling
August 4, 2026
9:24 AM
Where Marketing Teams Should Start With AI Agents
Rashan Dixon
August 4, 2026
8:00 AM
Stop Chasing Demos, Focus AI On Usefulness
Joe Rothwell
August 4, 2026
7:20 AM
U.S. Weighs Sanctions On Chinese AI Models
Rashan Dixon
August 3, 2026
4:14 PM
White House Presses Military on AI
Kirstie Sands
August 3, 2026
3:02 PM
Open Source Risk Management Beyond Vulnerability Scanning
Priya Nandakumar
August 3, 2026
2:35 PM
Global Crypto Rules Tighten As Enforcement Rises
Sumit Kumar
August 3, 2026
2:09 PM
Exclusion Claims Stir Tensions On Island
Rashan Dixon
August 3, 2026
1:42 PM
ASE Lifts Capex to $10.5 Billion
Steve Gickling
August 3, 2026
12:41 PM
Ceuta Border Sees Sudden Migrant Surge
Sumit Kumar
August 3, 2026
12:30 PM























