I’m trying to insert 10000 values into Oracle from C# and am using the code below. It is VERY important that the order of the values in the array that I pass in are maintained in Oracle, however every time I run this the order of the values changes. What can I change to stop the order changing, or is there a completely different approach that I can use to insert 10000 values in a set order that can be retrieved easily?
The datalist is an array of type double and size 10000.
var oc = new OracleConnection(ConnectionString);
oc.Open();
var transaction = oc.BeginTransaction();
OracleCommand command = new OracleCommand("",oc);
command.CommandText = ("INSERT INTO DEMO (DISTRIBUTIONSLICES) values (:DISTRIBUTIONSLICES)");
OracleParameter distributionslices = new OracleParameter("DISTRIBUTIONSLICES",OracleDbType.Varchar2, ParameterDirection.Input);
distributionslices.Value = datalist;
command.Parameters.Add(distributionslices);
command.ArrayBindCount = 10000;
command.ExecuteNonQuery();
Any help would be greatly appreciated.
(:DISTRIBUTIONSLICES, seq.nextval())
select in this way:
Select *
from demo
order by seq_id