mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-03-19 12:30:58 +08:00
修改Firebird 批量插入异常问题(BLOB SUB_TYPE TEXT需要参数化命令)。
This commit is contained in:
@@ -89,8 +89,18 @@ namespace FreeSql.Firebird
|
||||
if (value == null) return "NULL";
|
||||
if (type.IsNumberType()) return string.Format(CultureInfo.InvariantCulture, "{0}", value);
|
||||
if (type == typeof(byte[])) return $"x'{CommonUtils.BytesSqlRaw(value as byte[])}'";
|
||||
if (type == typeof(string) && col != null && (specialParamFlag == "c" || specialParamFlag == "cu"))
|
||||
return $"cast('{value.ToString().Replace("'", "''")}' as {col.Attribute.DbType.Replace("NOT NULL", "").Replace("NULL", "")})"; //#1923
|
||||
if (type == typeof(string))
|
||||
{
|
||||
if (col.Attribute.StringLength < 0)
|
||||
{
|
||||
var pam = AppendParamter(specialParams, $"p_{specialParams?.Count}{specialParamFlag}", null, type, value);
|
||||
return pam.ParameterName;
|
||||
}
|
||||
else if (col != null && (specialParamFlag == "c" || specialParamFlag == "cu"))
|
||||
{
|
||||
return $"cast('{value.ToString().Replace("'", "''")}' as {col.Attribute.DbType.Replace("NOT NULL", "").Replace("NULL", "")})"; //#1923
|
||||
}
|
||||
}
|
||||
return FormatSql("{0}", value, 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user