Entity string type - EF Core - 9.5.429
Posted: Tue 06 Feb 2018 05:12
I have the below configuration
[*]Devart.Data.Oracle.OracleException: ORA-01461: can bind a LONG value only for insert into a LONG column – this is because the code first entity framework string is limited to 2000 characters however the Nvarchar2 (4000) is not, by changing the text to Unicode its fixed
[*]Devart.Data.Oracle.OracleException (0x80004005): ORA-24920: column size too large for client – This is because the select query is failing to get over 2000 characters.
I'm wondering how can I map the string to nvarchar2(4000), without changing the model. ( I might be able to fix by giving stringlength 4000 on the model.) because I have to use this for MS SQL db support as well.
Is there any way that I can handle the situation ( over 2000 bytes) with Nvarchar2(4000) without changing it to unicode ??
Code: Select all
if (ServerOptionsConfig.IsOracle)
{
var config = Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance;
config.CodeFirstOptions.TruncateLongDefaultNames = true;
config.CodeFirstOptions.UseNonLobStrings = true;
config.DatabaseScript.Column.MaxStringSize = Devart.Data.Oracle.Entity.Configuration.OracleMaxStringSize.Extended;
//Nvarchar2(4000) complains on a long value insert because of the unicode default model string
config.CodeFirstOptions.UseNonUnicodeStrings = true;
config.CodeFirstOptions.ColumnTypeCasingConventionCompatibility = true;
config.Workarounds.DisableQuoting = true;
config.QueryOptions.CaseInsensitiveComparison = true;
config.QueryOptions.CaseInsensitiveLike = true;
}
[*]Devart.Data.Oracle.OracleException (0x80004005): ORA-24920: column size too large for client – This is because the select query is failing to get over 2000 characters.
I'm wondering how can I map the string to nvarchar2(4000), without changing the model. ( I might be able to fix by giving stringlength 4000 on the model.) because I have to use this for MS SQL db support as well.
Is there any way that I can handle the situation ( over 2000 bytes) with Nvarchar2(4000) without changing it to unicode ??