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.
The Full Breakdown of What Flat-Rate Managed IT Pricing Actually Covers
Marcus Whitfield
August 25, 2026
4:02 PM
$900 AI Litter Box Draws Scrutiny
Kirstie Sands
August 25, 2026
3:57 PM
MPs Challenge Government’s Proposed Ban
Steve Gickling
August 25, 2026
2:59 PM
Berd Keeps Conversation Data on User Devices
Deanna Ritchie
August 25, 2026
2:03 PM
Extension Options Could Lift Deal to $16.1B
Sumit Kumar
August 25, 2026
1:51 PM
Sleep Audio Device Targets Nighttime Ear Pain
Sumit Kumar
August 25, 2026
1:26 PM
Prepare Now for 2027 and 2028 Eclipses
Rashan Dixon
August 25, 2026
12:24 PM
AI Progress Needs Judgment, Not Fear or Hype
Joe Rothwell
August 25, 2026
11:53 AM
Climate Change Extends Invasive Species Threat
Rashan Dixon
August 25, 2026
11:46 AM
US States Seek Youth Social Media Overhaul
Steve Gickling
August 25, 2026
9:10 AM
Developer Productivity Tools Worth Adding to Your Stack in 2026
Rashan Dixon
August 25, 2026
8:00 AM
Osmosis Bypasses DJI Mimo for Downloads
Steve Gickling
August 24, 2026
1:30 PM
AI Prompt Offers Conversational Item Saving
Kirstie Sands
August 24, 2026
1:19 PM
Daniela Rus Wins Bavaria’s 2026 High-Tech Prize
Sumit Kumar
August 24, 2026
1:10 PM
Claude Code Adds Automatic Usage Resumption
Steve Gickling
August 24, 2026
12:51 PM
US Debt Warning Sharpens Fiscal Debate
Rashan Dixon
August 24, 2026
12:16 PM
Inertia Enterprises Speeds Fusion Fuel Filling
Sumit Kumar
August 24, 2026
9:30 AM
Developer Productivity Metrics That Help — and the Ones That Quietly Hurt
Rashan Dixon
August 24, 2026
8:00 AM
The Real Advantages of Cloud Computing for Lean Teams
Rashan Dixon
August 23, 2026
8:00 AM
The Best Cloud Computing Platforms for 2026, Compared Honestly
Rashan Dixon
August 22, 2026
8:00 AM
The World Doesn’t Change All at Once
Marcus Whitfield
August 21, 2026
3:30 PM
Dash Bio Raises $30 Million Series A
Sumit Kumar
August 21, 2026
2:56 PM
UAE Suspends Iran Trade After Talks Fail
Rashan Dixon
August 21, 2026
2:21 PM
Investing Club Sets Weekday Morning Meeting
Steve Gickling
August 21, 2026
1:48 PM
EA Ownership Raises Concerns for The Sims
Rashan Dixon
August 21, 2026
1:33 PM























