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.
Suspect Charged in WHCA Shooting
Deanna Ritchie
April 29, 2026
12:30 PM
Ant Group Trims Paytm Holding Again
Sumit Kumar
April 29, 2026
12:01 PM
ICE Investment Lifts Polymarket to $9B
Sumit Kumar
April 29, 2026
11:23 AM
Big Tech Dominates Trump Investment Claim
Steve Gickling
April 29, 2026
10:34 AM
Moore’s Law Survives Only If Chemistry Leads
Joe Rothwell
April 29, 2026
8:40 AM
Security Scrutiny After Near Trump Attack
Kirstie Sands
April 28, 2026
3:44 PM
Trump Halts Islamabad Delegation For Iran Talks
Rashan Dixon
April 28, 2026
3:30 PM
Google TV Adds Gemini AI Features
Deanna Ritchie
April 28, 2026
1:36 PM
Intel Forecast Lifts U.S. Chip Stocks
Steve Gickling
April 28, 2026
12:51 PM
From Grid to Growth: Electric Vehicles, Clean Energy, and the New Era of Energy Management
Johannah Lopez
April 28, 2026
12:38 PM
AI Progress Is Real, Hype Is Optional
Joe Rothwell
April 28, 2026
11:44 AM
Prediction Markets Collide With Layoff Watch
Steve Gickling
April 28, 2026
10:58 AM
Traza Raises $2.1 Million For AI Agents
Rashan Dixon
April 28, 2026
10:56 AM
Better Money Company Announces Crypto Partnerships
Sumit Kumar
April 28, 2026
10:29 AM
MIT Names 2026 Edgerton Award Winners
Sumit Kumar
April 28, 2026
9:34 AM
6 Reasons Your Architecture Produces “Mysterious” Latency Spikes
Kirstie Sands
April 27, 2026
3:25 PM
Trump Administration Weighs Aid For Spirit
Rashan Dixon
April 27, 2026
2:06 PM
Enterprises Reframe Agentic AI Deployment Strategy
Steve Gickling
April 27, 2026
12:39 PM
AI Features Now Permanent in Products
Steve Gickling
April 27, 2026
12:12 PM
Six Debugging Habits That Reduce Incident Resolution
Steve Gickling
April 27, 2026
11:54 AM
Navy Reviews Ford-Class Carrier Program
Kirstie Sands
April 27, 2026
11:33 AM
Tech Earnings Put Rally to the Test
Deanna Ritchie
April 27, 2026
10:30 AM
VR Struggles to Capture Smell
Sumit Kumar
April 27, 2026
10:23 AM
Breakout Stays Disciplined Amid Fund Frenzy
Sumit Kumar
April 27, 2026
10:04 AM
How to Evaluate Hidden Cloud Costs
Rashan Dixon
April 27, 2026
9:30 AM






















