I’m hoping to speed up some large scale ETL operations, that read and transform a bunch of stuff from strangely formatted flat files and an even stranger XML datastore, then insert many records into an Oracle dbms. I’m using ODP.NET 11g in C# / dotnet 4.
The OracleBulkCopy class seems like a good thing to try. The thing is, it wants to read its data from an IDataReader instance or an array of IDataRecord instances ( i.e. a resultset of some other dbms query).
Is there a straightforward way to wrap my data rows in an IDataReader or an array of IDataRecord classes, in memory so I can push them into OracleBulkCopy?
The examples I’ve found show data migration from one dbms to another. But, I’m trying to avoid writing these items one-by-one to a dbms so I can then bulk load them. I’d rather use the IDataReader equivalent of a memory stream. Thanks.
I had a similar problem, I was using Link2Sql and found problems in the performance. I have found a solution using reflection and extension methods, where I read the column data out of the ColumnAttribute.
The Entity looks like:
Using it is as easy as: