结果插入临时表新写法

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

结果插入临时表新写法

《每天一点点》 Meutopia string sql= string.Format(@" /dialect/ select * from table "); DataTable dt= DBServiceHelper.ExecuteDataSet(contxt, sql).Tables[0]; //结果插入临时表 string inpurTableName =AppServiceContext.DBService.CreateTemporaryTableName(this.Context); //创建临时表 string strsql = “/dialect/create table " + inpurTableName + " as select FENTRYID from table where 1<>1”; DBServiceHelper.Execute(this.Context, strsql); Dictionary<string, DbType> columnInfos = new Dictionary<string, DbType>(); columnInfos.Add(“FENTRYID”, DbType.Int64); BulkInsertAdapter bulkInsertAdapter = new BulkInsertAdapter(base.Context, columnInfos, inpurTableName, dt.Rows.Count); foreach (DataRow dc in dt.Rows) { DataRow newRow = bulkInsertAdapter.NewRow; newRow[“FENTRYID”] = Convert.ToInt64(dc[“FENTRYID”]); bulkInsertAdapter.Insert(newRow); } bulkInsertAdapter.Finish();

结果插入临时表新写法

《每天一点点》 Meutopiastring sql= string.Format(@" /dialect/ select * from table "); DataTable dt= DBServiceHelper.Ex...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息