我正在尝试在 Oracle DB 中插入值。我有一个存储过程,现在一次插入一行。但在这里阅读有关批量插入的更多信息(http://stackoverflow.com/questions/343299/bulk-insert-to-oracle-using-net,http://dotnetslackers.com/articles/ado_net/BulkOperationsUsingOracleDataProviderForNETODPNET.aspx),似乎最好将参数值作为数组传递。我有一个类似这样的通用列表,即employeeList。
class employee()
{
public int ID {get; set;}
public string Name {get; set;}
}
我如何调用我的存储过程(我知道我需要使用其中的参数进行更改,以获取参数数组)并将每个参数值作为数组传递以进行批量插入(尝试遵循示例链接)?
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 i.e. 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)?
发布评论
评论(1)
即使您传入一个数组,您仍然一次只能执行一个 DML。
如果您希望批量加载以提高速度,请写出一个文件并使用 SQL Loader 批量插入到您的表中。
这是获得数千行超快速性能的唯一方法。
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.