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.
What Is Amazon Ergo? AWS’s Open-Weight Coding Model Explained
Rashan Dixon
December 4, 2026
7:53 AM
What Is the AWS DuckDB Acquisition? Amazon Athena and Glue Explained
Deanna Ritchie
December 3, 2026
7:57 AM
7 Technologies Making Warehouses Safer and More Efficient
Rashan Dixon
December 2, 2026
10:06 AM
What Is Azure SRE Agent’s Multi-Cloud Support? AWS and Google Cloud Explained
Steve Gickling
December 2, 2026
7:54 AM
Matching Application Security Testing to Your Release Cadence
Rashan Dixon
December 1, 2026
4:28 PM
What Is GPT-6.2 Astra? OpenAI’s Benchmark-Topping Model Explained
Rashan Dixon
December 1, 2026
7:21 AM
What Businesses Should Consider When Selecting Perimeter Security Solutions
Steve Gickling
November 30, 2026
4:44 PM
What Is Anthropic’s Messages API Rust Rewrite? AI-Verified Migration Explained
Deanna Ritchie
November 30, 2026
11:18 AM
What Is Gemini 4 Neon? Google’s New Mid-Tier AI Model Explained
Steve Gickling
November 27, 2026
8:12 AM
What Is AI-Assisted Vulnerability Research? Chrome 158’s Claude-Found Bugs Explained
Rashan Dixon
November 26, 2026
8:02 AM
The Cheapest Ways to Run an AI Agent 24/7 in 2027 (Ranked)
John Rampton
November 25, 2026
1:52 PM
What Is Java4Shell? The Critical OpenJDK Base64 Vulnerability Explained
Deanna Ritchie
November 25, 2026
8:05 AM
What Is the Agent-Framework PyPI Attack? Microsoft’s Credential Stealer Explained
Steve Gickling
November 24, 2026
7:59 AM
One Design System for the Product and the Marketing Site, or Two?
Rashan Dixon
November 23, 2026
3:12 PM
What Is NGINX2Root? The Critical NGINX RCE Vulnerabilities Explained
Rashan Dixon
November 23, 2026
7:28 AM
How Fintech Is Transforming the Way Consumers Manage Monthly Bills
Steve Gickling
November 20, 2026
11:53 AM
What Is .NET 11? C# 15 Union Types and AI Tooling Explained
Deanna Ritchie
November 20, 2026
10:51 AM
Just-in-Time Privileged Access Should Be Scoped to Tasks, Not People
kellybryson
November 19, 2026
2:19 PM
What Is Windows 11’s Coding Agent Telemetry? Privacy Risk Explained
Steve Gickling
November 19, 2026
7:41 AM
What Is the cPGuard Supply Chain Attack? OpsShield’s Backdoor Explained
Rashan Dixon
November 18, 2026
8:31 AM
What Is wfx-loot? The GitHub Actions Secret Stealer Attack Explained
Deanna Ritchie
November 17, 2026
8:38 AM
What Is Gemini 4 Hydrogen? Google’s Fast, Low-Cost Coding Model Explained
Steve Gickling
November 16, 2026
8:08 AM
What Is GPT-6 Cyber? OpenAI’s New Cybersecurity AI Model Explained
Rashan Dixon
November 13, 2026
8:08 AM
What Is Microsoft’s November 2026 Patch Tuesday? Outlook Zero-Day Explained
Deanna Ritchie
November 12, 2026
8:08 AM
What Is Claude Fable 5.2? Anthropic’s New Flagship Model Explained
Steve Gickling
November 11, 2026
8:12 AM
























