Page 1 of 1

Suggestion: OracleLoader to support IDataReader as a row source

Posted: Mon 05 May 2014 13:02
by Dennis Wanke
I suggest OracleLoader (in fact, all DbLoader descendants) should provide a method for importing data from a data Reader (in addition to LoadTable() that accepts a DataTable).

Re: Suggestion: OracleLoader to support IDataReader as a row source

Posted: Wed 07 May 2014 14:58
by Pinturiccio
We will investigate the possibility to import data from OracleDataReader with OracleLoader and post here about the results as soon as possible.

Re: Suggestion: OracleLoader to support IDataReader as a row source

Posted: Wed 07 May 2014 15:27
by Dennis Wanke
In fact we've already implemented this logic:

Code: Select all

loader.Open();
while (reader.Read())
{
    foreach (OracleLoaderColumn column in loader.Columns)
    {
        var name = column.Name;
        loader.SetValue(name, reader.GetValue(reader.GetOrdinal(name)));
    }
    loader.NextRow();
}
But maybe you can do it more optimally. You may also consider an option similar to SqlBulkCopy.EnableStreaming.