Suggestion: OracleLoader to support IDataReader as a row source

Suggestion: OracleLoader to support IDataReader as a row source

Postby Dennis Wanke » Mon 05 May 2014 13:02

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).
Dennis Wanke
 
Posts: 57
Joined: Tue 11 Mar 2014 07:49

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

Postby Pinturiccio » Wed 07 May 2014 14:58

We will investigate the possibility to import data from OracleDataReader with OracleLoader and post here about the results as soon as possible.
Pinturiccio
Devart Team
 
Posts: 1997
Joined: Wed 02 Nov 2011 09:44

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

Postby Dennis Wanke » Wed 07 May 2014 15:27

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.
Dennis Wanke
 
Posts: 57
Joined: Tue 11 Mar 2014 07:49


Return to dotConnect for Oracle