在对PostgreSQL数据库进行批量更新时遇到了挑战。
foreach (var data in dataList)
{
using (var context = new eedcgisdbEntities1())
{
var entityList = context.Set<dss_outage_status_2>().Where(entity => entity.dss_id == "402101002701").ToList();
foreach (var entity in entityList)
{
entity.outage_status = "0";
}
**context.BulkUpdate(entityList);**
}
}
Context.BulkUpdate引发错误: {错误:42601:“ [”}
或附近的语法错误似乎正在尝试将RAW SQL发送到不被接受的postgreSQL
CREATE TABLE [sde].[_tmp8ef457]([dss_id] numeric(29, 15), [transformer_name] varchar(50),
[transformer_code] varchar(50), [outage_status] smallint, [today_uptime] varchar(50), [updatedby]
varchar(50), [updatedat] timestamptz);
它抱怨SQL错误
请问如何解决此问题?