简体   繁体   中英

Oracle Bulk Insert using C#?

I am trying to insert values in Oracle DB. I have a stored procedure which right now insert one row at a time. But reading more about bulk insert here (http://stackoverflow.com/questions/343299/bulk-insert-to-oracle-using-net, http://dotnetslackers.com/articles/ado_net/BulkOperationsUsingOracleDataProviderForNETODPNET.aspx ), it seems like it is better to pass parameter value as an array. I have a generic list something like this ie employeeList.

class employee()
{ 
  public int ID {get; set;} 
   public string Name {get; set;}
}

How can i call my stored procedure (i know i need to make change with my in parameter in it, to take array of parameter) and pass each parameter value as an array to do bulk insert (trying to follow the example link)?

Even if you pass in an array you still can only do one DML at a time.
If you are wanting bulk loading for speed, write out a file and use SQL Loader bulk insert into your table.
It is the only way to get super fast performance for thousands of rows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM