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.
Why Big-Battery Phones Finally Make Sense
Joe Rothwell
June 20, 2026
10:37 AM
The State of DevSecOps 2026: Shifting Security Left in the AI Age
Rashan Dixon
June 20, 2026
9:23 AM
Mistral AI Launches Vibe, Targets Industry
Sumit Kumar
June 19, 2026
3:49 PM
Colbert Ends Tenure With Musical Jab
Deanna Ritchie
June 19, 2026
2:31 PM
Stratofortress Crash Kills Eight in California
Kirstie Sands
June 19, 2026
1:08 PM
AI-Native Applications: Designing Software That Learns Continuously
Rashan Dixon
June 19, 2026
11:14 AM
Amazon And Meta Lead Tech Rally
Rashan Dixon
June 19, 2026
10:38 AM
Bear Stalking Prompts Mount Si Closure
Steve Gickling
June 19, 2026
10:21 AM
SpaceX Adds Ex-Sequoia Leader to Board
Sumit Kumar
June 19, 2026
10:03 AM
How Specialized Engineering Talent Helps Modern Tech Companies Build Better Products
Kyle Lewis
June 19, 2026
9:10 AM
Local AI Is Ready—But Not For Everyone
Joe Rothwell
June 19, 2026
6:00 AM
Index Hopes Fuel Pre-Inclusion Stock Surge
Rashan Dixon
June 18, 2026
3:28 PM
New Fix Targets AI Chatbot Freezes
Steve Gickling
June 18, 2026
2:26 PM
Portable Projectors Get Smarter And Simpler
Kirstie Sands
June 18, 2026
2:23 PM
Deferred Deep Linking vs Standard Deep Linking in Android
Amelia Blackwood
June 18, 2026
2:11 PM
Debate Grows Over Musk’s Labor Record
Sumit Kumar
June 18, 2026
12:19 PM
The Microservices Backlash: When Monoliths Make a Comeback
Rashan Dixon
June 18, 2026
10:13 AM
New WRING Method Tackles AI Bias
Rashan Dixon
June 18, 2026
9:45 AM
Daily Wire Confronts Layoffs And Infighting
Deanna Ritchie
June 17, 2026
1:34 PM
MoneyGram Adds Stablecoin Settlement, Validates Blockchain
Sumit Kumar
June 17, 2026
11:33 AM
UK Confirms Under-16 Ban, Lessons Abroad
Rashan Dixon
June 17, 2026
10:33 AM
Observability in 2026: How OpenTelemetry Became the Industry Standard
Rashan Dixon
June 17, 2026
10:14 AM
Experts Weigh Real Risk Of AI
Rashan Dixon
June 17, 2026
9:25 AM
Zip Debuts AI Agents For Procurement
Sumit Kumar
June 17, 2026
9:12 AM
Y Combinator Brings Fintech Interviews To NYC
Sumit Kumar
June 16, 2026
4:32 PM


















