vsarathy
08-05-2007, 10:55 PM
Hi,
I have a .NET/C# application that tries to insert close to 3 Milliion records into a database. We are using Oracle 9i. The data access component I use for the inserts has been implemented using the AdoTemplate and the ICommandCallback classes in Spring Framework.
While using this approach, there does not seem to be a way to insert a whole array of data in a single execution of command.ExecuteNonQuery() statement. You can do this if you are directly using the classes provided by ODP.NET provider using the "array binding" feature as follows:
String[] arrayOfValues = ..
OracleParameter param = new OracleParameter ();
param.Type = OracleDbType.VarChar2;
param.Value = arrayOfValues;
OracleConnention connection = ..
OracleCommand command = ..
command.Connection = connection;
command.CommandType = CommandType.Text;
command.ArrayBindCount = arrayOfValues.Length;
command.ExecuteNonQuery ();
Is there an equivalent to the above while using the DAO abstractions provided by Spring Framework. I only seem to be able to set a scalar value to the IDbDataParameter.Value property.
As far as I can see, even the classes in System.Data.OracleClient in .NET SDK do not seem to support this.
Any help is greatly apppreciated.
Viji
I have a .NET/C# application that tries to insert close to 3 Milliion records into a database. We are using Oracle 9i. The data access component I use for the inserts has been implemented using the AdoTemplate and the ICommandCallback classes in Spring Framework.
While using this approach, there does not seem to be a way to insert a whole array of data in a single execution of command.ExecuteNonQuery() statement. You can do this if you are directly using the classes provided by ODP.NET provider using the "array binding" feature as follows:
String[] arrayOfValues = ..
OracleParameter param = new OracleParameter ();
param.Type = OracleDbType.VarChar2;
param.Value = arrayOfValues;
OracleConnention connection = ..
OracleCommand command = ..
command.Connection = connection;
command.CommandType = CommandType.Text;
command.ArrayBindCount = arrayOfValues.Length;
command.ExecuteNonQuery ();
Is there an equivalent to the above while using the DAO abstractions provided by Spring Framework. I only seem to be able to set a scalar value to the IDbDataParameter.Value property.
As far as I can see, even the classes in System.Data.OracleClient in .NET SDK do not seem to support this.
Any help is greatly apppreciated.
Viji