Update Oracle SubInsert BUG

This commit is contained in:
skx
2020-10-30 18:29:36 +08:00
parent 96aabd2ff7
commit 8fc8cbc511
2 changed files with 9 additions and 0 deletions

View File

@@ -202,6 +202,10 @@ namespace SqlSugar
{ {
if (item.IsIdentity||item.IsIgnore) if (item.IsIdentity||item.IsIgnore)
continue; continue;
if (!string.IsNullOrEmpty(item.OracleSequenceName)&&this.Context.CurrentConnectionConfig.DbType==DbType.Oracle)
{
pkValue = "{SugarSeq:=}"+item.OracleSequenceName+ ".nextval{SugarSeq:=}";
}
if (item.PropertyInfo.Name == key) if (item.PropertyInfo.Name == key)
{ {
insertDictionary.Add(item.DbColumnName, pkValue); insertDictionary.Add(item.DbColumnName, pkValue);

View File

@@ -96,6 +96,11 @@ namespace SqlSugar
batchInsetrSql.AppendLine("SELECT 1 FROM DUAL"); batchInsetrSql.AppendLine("SELECT 1 FROM DUAL");
} }
var result= batchInsetrSql.ToString(); var result= batchInsetrSql.ToString();
if (result.Contains("{SugarSeq:=}"))
{
result = result.Replace("\"{SugarSeq:=}", "");
result = result.Replace("{SugarSeq:=}\"", "");
}
return result; return result;
} }
} }