BartAtRanch
BartAtRanch

Reputation: 127

Fast inserts into Oracle from C# program

I have a C# program that reads data from SQL Server, does analysis and number crunching on it, then writes output results back to the SQL Server database. I use the BulkCopy class of the SQL Server .NET driver to quickly insert the data.

My program can work just fine with reading data from Oracle. It is writing the output data back to Oracle that I am having problems with. The current .NET Oracle driver does not support a BulkCopy class. Due to the large amount of data I need to write, a row by row insert into Oracle is prohibitively slow.

Does anyone have a solution for rapid insertion of a large number of rows into Oracle from a C# program?

Upvotes: 0

Views: 620

Answers (1)

Dan Guzman
Dan Guzman

Reputation: 46203

Rather than the Microsoft provided Oracle provider, use the Oracle Data Provider for .NET distributed by Oracle. This includes an OracleBulkCopy class which is optimized for mass inserts with an interface similar to SqlBulkCopy. It's generally best to use provider/driver supplied by the DBMS vendor.

Upvotes: 1

Related Questions