mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-08 17:30:55 +08:00
- 修复 Oracle CodeFirst clob/blob cast 转换问题;
This commit is contained in:
@@ -390,8 +390,9 @@ and not exists(select 1 from all_constraints where constraint_name = a.index_nam
|
||||
insertvalue = _commonUtils.QuoteSqlName(tbstructcol.column);
|
||||
if (tbcol.Attribute.DbType.StartsWith(tbstructcol.sqlType, StringComparison.CurrentCultureIgnoreCase) == false)
|
||||
{
|
||||
var dbtypeNoneNotNull = Regex.Replace(tbcol.Attribute.DbType, @"(NOT\s+)?NULL", "");
|
||||
insertvalue = $"cast({insertvalue} as {dbtypeNoneNotNull})";
|
||||
var dbtypeNoneNotNull = Regex.Replace(tbcol.Attribute.DbType, @"(NOT\s+)?NULL", "").Trim();
|
||||
if (dbtypeNoneNotNull != "CLOB" && dbtypeNoneNotNull != "BLOB")
|
||||
insertvalue = $"cast({insertvalue} as {dbtypeNoneNotNull})";
|
||||
}
|
||||
if (tbcol.Attribute.IsNullable != tbstructcol.is_nullable)
|
||||
insertvalue = $"nvl({insertvalue},{tbcol.DbDefaultValue})";
|
||||
|
||||
Reference in New Issue
Block a user