Esempio n. 1
0
        /// <summary>
        /// 批量插入数据。 先清临时表,再bulkcopy到临时表
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="dt"></param>
        /// <param name="procedureName"></param>
        private void bulkInsert(String tableName, DataTable dt, String strDDBH, String strCustId)
        {
            String sql = "delete from " + tableName + " where SEQNO='" + strDDBH + "'";

            DbHelperOra.ExecuteSql(sql);
            ApiUtil.BulkInsert(tableName, dt);
        }
Esempio n. 2
0
        /// <summary>
        /// 批量插入数据。 先清临时表,bulkcopy到临时表,再调存储过程插入到正式表
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="dt"></param>
        /// <param name="procedureName"></param>
        private void bulkInsert(String tableName, DataTable dt, String procedureName)
        {
            String sql = "delete from " + tableName + " where custid = '" + CustId + "' and ddbh='" + SeqNo + "'";

            DbHelperOra.ExecuteSql(sql);
            ApiUtil.BulkInsert(tableName, dt);
            if (!String.IsNullOrWhiteSpace(procedureName))
            {
                OracleParameter[] param =
                {
                    new OracleParameter("VS_SEQNO",  OracleDbType.Varchar2, 40),
                    new OracleParameter("VS_CUSTID", OracleDbType.Varchar2, 20)
                };
                param[0].Direction = ParameterDirection.Input;
                param[0].Value     = SeqNo;
                param[1].Direction = ParameterDirection.Input;
                param[1].Value     = CustId;

                DbHelperOra.RunProcedure(procedureName, param);
            }
        }