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.
6 Signals Your System Is Sliding Into Operational Drift
Steve Gickling
March 5, 2026
4:56 PM
Six Reasons Your AI Prototype Fails in Production
Rashan Dixon
March 5, 2026
4:46 PM
7 Early Signs Your AI Guardrails Won’t Hold in Production
Kirstie Sands
March 5, 2026
4:37 PM
How to Scale Search Infrastructure for High-Query Volumes
Sumit Kumar
March 5, 2026
4:21 PM
Technical Influence vs Authority in Engineering Teams
Steve Gickling
March 5, 2026
4:09 PM
Optical Links Challenge Copper In Data Centers
Rashan Dixon
March 5, 2026
3:48 PM
Empathy Guides Rosalyn Engelman’s Partnership
Rashan Dixon
March 5, 2026
3:25 PM
Apple M5 Chips Target On-Device AI
Sumit Kumar
March 5, 2026
2:41 PM
Sophia Space Raises $10 Million Seed
Steve Gickling
March 5, 2026
2:29 PM
Charles Payne Hosts Investor Town Hall
Kirstie Sands
March 5, 2026
2:16 PM
Xiaomi Highlights New Tech At MWC
Steve Gickling
March 5, 2026
2:13 PM
Berkshire Hathaway Q4 Profit Falls Nearly 30 Percent
Deanna Ritchie
March 5, 2026
2:04 PM
Amazon Debuts AI Dynamic Canvas for Sellers
Sumit Kumar
March 5, 2026
9:13 AM
Phones Are Ready For Serious Offline AI
Joe Rothwell
March 5, 2026
8:10 AM
4 Architectural Decisions That Shape Reliable RAG Systems
Rashan Dixon
March 4, 2026
4:47 PM
OpenAI Chair Sees AI Reshaping Work
Sumit Kumar
March 4, 2026
1:21 PM
Venezuelan Oil Rebranded As Brazilian To China
Steve Gickling
March 4, 2026
1:05 PM
OpenAI Defends Safeguards In Defense Deal
Sumit Kumar
March 4, 2026
12:31 PM
Samsung Brings Phone-Based Door Unlocking
Deanna Ritchie
March 4, 2026
12:21 PM
Smartphones Deliver Net Gains, Data Shows
Steve Gickling
March 4, 2026
10:23 AM
Asking AI Chatbots Changes How We Learn
Rashan Dixon
March 4, 2026
10:10 AM
AI Rekindles Debate Over Photography
Rashan Dixon
March 4, 2026
10:01 AM
7 Refactor Patterns That Compound Over Years
Kirstie Sands
March 3, 2026
4:49 PM
DOJ Files Link Epstein To Russian Investors
Rashan Dixon
March 3, 2026
4:47 PM
Citadel, Ark Invest Buy ZRO Token
Sumit Kumar
March 3, 2026
4:42 PM






