日期:2014-05-17 浏览次数:20760 次
String sql = "update ADJUST set alpha=@alpha where systemMark='a' and orderid=@orderid"; OracleTransaction tx = new OracleTransaction(); tx.begin(); OracleCommand = new OracleCommand(conn, sql); for (int i = 0; i<10000; i++) { OracleParameter[] params = new OracleParameter[2]; params[0] = cmd.Parameters.Add(..) params[1] = cmd.Parameters.Add(..) rowsAffected = cmd.ExecuteNonQuery(); cmd.Parameters.Clear(); if ((i+1) % 1000 ==0) { tx.commit(); tx.begin(); } } tx.commit();