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.
Smartphone Cameras Aren’t The Excuse Anymore
Joe Rothwell
March 28, 2026
10:46 AM
Six Signs Your Domain Model Is Quietly Breaking
Steve Gickling
March 27, 2026
5:00 PM
US-China AI Race Spurs Job Fears
Sumit Kumar
March 27, 2026
4:27 PM
Database Normalization Explained (and When to Denormalize)
Rashan Dixon
March 27, 2026
3:00 PM
Crypto Newsletters Target Afternoon Readers
Sumit Kumar
March 27, 2026
1:47 PM
Skepticism Greets Claimed US Ceasefire Push
Steve Gickling
March 27, 2026
1:46 PM
API Gateway Design Patterns for Large-Scale Systems
Kirstie Sands
March 27, 2026
1:38 PM
NASA Outlines $20 Billion Moon Base
Kirstie Sands
March 27, 2026
12:08 PM
Wave-Former Uses Wireless Signals For 3D Scenes
Steve Gickling
March 27, 2026
11:52 AM
Understanding Circuit Breaker Patterns for Resilience
Sumit Kumar
March 27, 2026
11:29 AM
A Nationwide Pause Would Empower Big Tech
Joe Rothwell
March 27, 2026
10:20 AM
Mastercard Details AI Fraud Detection Upgrade
Deanna Ritchie
March 27, 2026
9:38 AM
Autonomous AI Agent Self-Improves Through Experiments
Rashan Dixon
March 27, 2026
9:31 AM
The Role of Message Queues in System Reliability
Steve Gickling
March 27, 2026
9:19 AM
UK Weighs Australia-Style Ban Consultation
Rashan Dixon
March 27, 2026
9:07 AM
Nathan Newby To Receive George Medal
Rashan Dixon
March 26, 2026
2:56 PM
How To Unlock iPhone: Carrier Unlock, Passcode & Activation Lock (2026)
Editorial Staff
March 26, 2026
2:26 PM
How To Change iPhone Name: Bluetooth, AirDrop & WiFi Name (2026)
Editorial Staff
March 26, 2026
2:25 PM
How To Turn Off Find My iPhone: Step-by-Step Guide (2026)
Editorial Staff
March 26, 2026
2:25 PM
How To Factory Reset Apple Watch: Complete Guide (2026)
Editorial Staff
March 26, 2026
2:24 PM
How To Turn Off Do Not Disturb on iPhone and Android (2026)
Editorial Staff
March 26, 2026
2:24 PM
What Is My Phone Number? How To Find It on iPhone and Android (2026)
Editorial Staff
March 26, 2026
2:23 PM
How To Block Your Number When Calling: iPhone, Android & Landline (2026)
Editorial Staff
March 26, 2026
2:23 PM
833 Area Code: Who Is Calling Me? Everything You Need To Know (2026)
Editorial Staff
March 26, 2026
2:22 PM
How To Find Your AirPods: Every Method Explained (2026)
Editorial Staff
March 26, 2026
2:21 PM













