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.
Analog Cameras Defy The Digital Tide
Steve Gickling
May 11, 2026
2:50 PM
A16z Leads $16 Million Seed For Pit
Sumit Kumar
May 11, 2026
2:36 PM
Citgo Posts $82 Million Q1 Loss
Rashan Dixon
May 11, 2026
1:47 PM
Microsoft Adds GPT-5.5 Instant to Copilot
Deanna Ritchie
May 11, 2026
12:24 PM
AI Takes Center Stage At GeekWire Awards
Rashan Dixon
May 11, 2026
11:39 AM
Pentagon Accelerates AI Amid Guardrail Debate
Sumit Kumar
May 11, 2026
10:57 AM
How All-In-One Mechanical Design Software Can Empower Engineers
Amelia Blackwood
May 11, 2026
10:32 AM
Foldable iPhone Hype Needs Realistic Expectations Now
Joe Rothwell
May 9, 2026
9:43 AM
Estate Tactic Targets Carried Interest Taxes
Sumit Kumar
May 8, 2026
3:57 PM
Sonos Interim CEO Signals Post-Software Recovery
Steve Gickling
May 8, 2026
3:49 PM
Leaked Texts Reveal Fears Over Musk Role
Deanna Ritchie
May 8, 2026
3:37 PM
Researchers Predict Heart Failure a Year Ahead
Steve Gickling
May 8, 2026
3:24 PM
OpenAI President’s Quip Spurs Debate
Rashan Dixon
May 8, 2026
2:27 PM
Apple Faces Defining Test In AI
Sumit Kumar
May 8, 2026
12:25 PM
Early OpenAI Culture Favored Altman’s Presence
Kirstie Sands
May 8, 2026
12:19 PM
DoorDash Ramps Spending On New Platform
Rashan Dixon
May 8, 2026
10:03 AM
Second Brains Should Think, Not Just Store Data
Joe Rothwell
May 8, 2026
8:39 AM
AI for Business Growth: Why Most Companies Fail to See Results. Insights from Denis Salatin, Founder & CEO of Lumitech
Amelia Blackwood
May 7, 2026
2:14 PM
Drug Price Pledge Hits Pharma Stocks
Kirstie Sands
May 7, 2026
1:49 PM
How Direct Price Comparisons Make Crypto Easy for Beginners
Johannah Lopez
May 7, 2026
1:36 PM
CNN Highlights Daily ‘5 Things AM’ Briefing
Sumit Kumar
May 7, 2026
12:46 PM
Federal Case Probes OpenAI’s Shift
Steve Gickling
May 7, 2026
11:18 AM
NASA Releases 12,000 Artemis II Photos
Steve Gickling
May 7, 2026
9:54 AM
Council Reports Three Waste Fires This Year
Rashan Dixon
May 7, 2026
9:53 AM
Pennsylvania Sues Chatbot Over Medical Claims
Deanna Ritchie
May 7, 2026
9:37 AM






















