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.
Gaming Platforms Reaffirm Subscription Fees
Sumit Kumar
June 26, 2026
4:48 PM
Goalkeepers Confront Unpredictable Ball Movement
Rashan Dixon
June 26, 2026
2:03 PM
Leah Stewart Stabilizes, Faces Hand Recovery
Deanna Ritchie
June 26, 2026
1:54 PM
AI Insurance Expands Into Disaster Zones
Rashan Dixon
June 26, 2026
1:44 PM
Community Skills Are Rewiring How We Code
Joe Rothwell
June 26, 2026
1:36 PM
How to Choose the Perfect Modern Office Table for Your Workspace
Johannah Lopez
June 26, 2026
12:30 PM
Take-Two Sets GTA VI Price, Date
Steve Gickling
June 26, 2026
9:33 AM
Apple Defends Competition Amid Antitrust Scrutiny
Steve Gickling
June 26, 2026
9:19 AM
Nashville Moves To Manage Data Center Boom
Kirstie Sands
June 26, 2026
9:15 AM
Debate Grows Over Long Covid Treatments
Deanna Ritchie
June 25, 2026
4:43 PM
Design Leaders Push Reusable Templates
Steve Gickling
June 25, 2026
2:09 PM
Startup Tests Ocean-Powered Data Centers
Rashan Dixon
June 25, 2026
1:26 PM
SoftBank Launches AI Cybersecurity Service
Rashan Dixon
June 25, 2026
12:40 PM
California Drivers Sue Fuel Retailers Over AI Pricing
Steve Gickling
June 25, 2026
11:30 AM
Kyiv Hits Crimea Rail Bridge, Power Plant
Kirstie Sands
June 25, 2026
10:30 AM
Networks Promote Curated Headline Feeds
Deanna Ritchie
June 24, 2026
3:35 PM
The Engineering Behind a Prop Firm: How Platforms Like OneFunded Are Built to Evaluate, Fund, and Scale Thousands of Traders Simultaneously
Johannah Lopez
June 24, 2026
1:57 PM
What Should Developers Know About Handling User-Uploaded Files Securely?
Noah Nguyen
June 24, 2026
11:36 AM
Tata Electronics Faces Scrutiny Amid Expansion
Sumit Kumar
June 24, 2026
11:24 AM
CNN Promotes ‘5 Things AM’ Briefing
Steve Gickling
June 24, 2026
10:38 AM
Quantum Computing Promise And Limits Explained
Sumit Kumar
June 24, 2026
9:23 AM
Perplexity Unveils Hybrid Local-Cloud AI
Rashan Dixon
June 24, 2026
9:07 AM
Light Phone Champions Minimal Use Philosophy
Deanna Ritchie
June 23, 2026
3:54 PM
Mexico Edges South Korea, Leads Group A
Rashan Dixon
June 23, 2026
3:12 PM
Securing the Connections Between AI Agents, Tools, and Data
Noah Nguyen
June 23, 2026
1:53 PM























