What i need to do is this: I got an array with lets say 100000 values, For each value i need to make the same query ,just change that specific value. Now, i am thinking that if i loop all this values in my c#/ java code and reach for a query it would take a lot of time. My other option is doing all the work in my db, populate a temp table and than reading back in my code from that temp table.
What is the fastest way of doing such thing?
private void GetValues(List<Element> _Elements)
{
foreach (Element e in _Elements)
{
using (OracleCommand cmd = new OracleCommand())
{
cmd.Connection = _conn;
cmd.CommandText = "select value from table where something = " +e.Indicator;
using(OracleDataReader r = cmd.ExecuteReader());
while (r.Read())
{
e.setvalue = r.GetString(1);
}
r.Close();
}
}
}
}
[Editor note: question was originally unclear as to whether it was C# or Java -- but the languages are largely equivalent, and answers should be applicable to both.]