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.
Platforms Promote 18-Plus Betting Access
Sumit Kumar
June 1, 2026
4:40 PM
Google Confirms Fitbit App Won’t Return
Steve Gickling
June 1, 2026
4:14 PM
Building Internal Tools for the Trades Without a Dev Team: The Dalton Mills Approach
Johannah Lopez
June 1, 2026
3:55 PM
Karpathy’s Open Source Path at Anthropic
Steve Gickling
June 1, 2026
3:44 PM
ProEncia Raises Pre-Seed For Gum Disease
Sumit Kumar
June 1, 2026
1:47 PM
BBC Verify Analyzes Strikes On Russian Trucks
Rashan Dixon
June 1, 2026
12:27 PM
Nvidia Keynote Set To Dominate Computex
Kirstie Sands
June 1, 2026
11:15 AM
The Developer Burnout Crisis: What 2026 Data Reveals About Mental Health in Tech
Rashan Dixon
June 1, 2026
10:11 AM
Wireless Audio Moves Toward Lossless Support
Deanna Ritchie
June 1, 2026
9:33 AM
Blue Origin Rocket Explosion Clouds Moon Plans
Rashan Dixon
June 1, 2026
9:27 AM
Serverless 2.0: The Comeback of Function-as-a-Service in 2026
Rashan Dixon
May 31, 2026
7:46 AM
Chipmaking’s Future Demands Bigger, Stranger Machines
Joe Rothwell
May 31, 2026
5:57 AM
High-End Projectors Don’t Need Smart Tricks
Joe Rothwell
May 30, 2026
11:04 AM
Cybersecurity for AI Models: Defending Against Prompt Injection and Model Theft
Rashan Dixon
May 30, 2026
6:36 AM
Shivon Zilis Details Role in AI Giant
Deanna Ritchie
May 29, 2026
5:10 PM
Experts Question Quantum Algorithms for Chemistry
Kirstie Sands
May 29, 2026
4:32 PM
How Integrated Mobile and Web Solutions Drive End-to-End Digital Transformation
Grace Phillips
May 29, 2026
3:22 PM
Leading Identity Verification Software with Adaptive Fraud Detection in 2026
Jordan Williams
May 29, 2026
3:02 PM
AlphaGo Intern Reflects on Legacy
Rashan Dixon
May 29, 2026
12:31 PM
AI Agents in DevOps: The Rise of Autonomous Pipelines in 2026
Rashan Dixon
May 29, 2026
10:37 AM
Free Apps Should Work For Us, Not Mine Us
Joe Rothwell
May 29, 2026
9:58 AM
Stord Raises $250 Million at $3 Billion
Sumit Kumar
May 29, 2026
9:52 AM
Nebius Shares Jump on Strategic Investment
Rashan Dixon
May 29, 2026
9:38 AM
Thousands Challenge Bambu With Legal Dare
Kirstie Sands
May 28, 2026
1:45 PM
CD Projekt Plans New Witcher Expansion
Steve Gickling
May 28, 2026
1:16 PM

















