zoukankan      html  css  js  c++  java
  • Oracle批量插入在C#中的应用

    public void SetUserReportResult(int[] reportId, bool isReceive, string result)
            {
                if (reportId == null)
                    throw new ArgumentNullException("reportId");
                result = result.Left(80);
                string sql = "update msg_user_receive_report set isreceive=" + Convert.ToInt32(isReceive) + ",";
                if (!isReceive)
                    sql += "ukey='0',";
    
                var resultParam = "null";
                if (result != null)
                    resultParam = "'" + result.Replace("'", "''") + "'";
    
                sql += "result=" + resultParam + ",retrycount=retrycount+1,userreceivetime=sysdate where id=:reportId";
                Stopwatch watch;
                using (var connection = this.CreateConnection())
                {
                    using (var command = connection.CreateCommand())
                    {
                        var size = reportId.Length;
                        command.CommandText = sql;
                        command.ArrayBindCount = size;
                        command.Parameters.Add(new OracleParameter("reportId", OracleDbType.Int32) { Value = reportId });
                        connection.Open();
                        watch = Stopwatch.StartNew();
                        var c = command.ExecuteNonQuery();
                        watch.Stop();
                    }
                    connection.Close();
                }
                Trace.TraceInformation("Data.SetUserReportResult,watch=" + watch.ElapsedMilliseconds);
            }
  • 相关阅读:
    iOS 列表三级展开
    iOS 聊天界面
    iOS 地图(添加大头针)
    iOS 地图
    swift 快速创建一些基本控件
    swift
    swift
    swift4.2 打印所有系统字体
    Xcode 去掉控制台无用打印信息
    swift
  • 原文地址:https://www.cnblogs.com/rengke2002/p/7462516.html
Copyright © 2011-2022 走看看