ver. 6.30 and ORA-12704: character set mismatch
ver. 6.30 and ORA-12704: character set mismatch
Hello,
we have upgraded to ver. 6.30.160 and some of our linq entity queries ceased to work properly. We are getting the Oracle error message "ORA-12704: character set mismatch" which was never seen with previous versions (ver. 6.10 and previous).
After some analysis we've found the problem is the function call to TO_NCHAR() in the translated SQL query. After manual replacement by TO_CHAR() the query works without problems.
The linq looks like this :
... where entity.property == "A" ...
What has changed in the SQL code generation that could cause these problems? Thank you for any help
we have upgraded to ver. 6.30.160 and some of our linq entity queries ceased to work properly. We are getting the Oracle error message "ORA-12704: character set mismatch" which was never seen with previous versions (ver. 6.10 and previous).
After some analysis we've found the problem is the function call to TO_NCHAR() in the translated SQL query. After manual replacement by TO_CHAR() the query works without problems.
The linq looks like this :
... where entity.property == "A" ...
What has changed in the SQL code generation that could cause these problems? Thank you for any help
Last edited by aldare on Tue 24 May 2011 10:57, edited 1 time in total.
I have a same issue - ORA-12704: character set mismatch after update to version 6.30.
If I use in the generated SELECT function TO_CHAR instead of TO_NCHAR then SELECT works fine. I don't have any national datatype (nchar, nvarchar...) in tables but dotConnect using TO_NCHAR function in the CAST command.
There is probably relationship with the Oracle document ID 742684.1 on Metalink.
My database parameters:
NLS_LANGUAGE = AMERICAN
NLS_TERRITORY = AMERICA
NLS_CURRENCY = $
NLS_ISO_CURRENCY = AMERICA
NLS_NUMERIC_CHARACTERS = .,
NLS_CHARACTERSET = AL32UTF8
NLS_CALENDAR = GREGORIAN
NLS_DATE_FORMAT = DD-MON-RR
NLS_DATE_LANGUAGE = AMERICAN
NLS_SORT = BINARY
NLS_TIME_FORMAT = HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT = DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT = HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT = DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY = $
NLS_COMP = BINARY
NLS_LENGTH_SEMANTICS = CHAR
NLS_NCHAR_CONV_EXCP = FALSE
NLS_NCHAR_CHARACTERSET = AL16UTF16
NLS_RDBMS_VERSION = 11.2.0.1.0
If I use in the generated SELECT function TO_CHAR instead of TO_NCHAR then SELECT works fine. I don't have any national datatype (nchar, nvarchar...) in tables but dotConnect using TO_NCHAR function in the CAST command.
There is probably relationship with the Oracle document ID 742684.1 on Metalink.
My database parameters:
NLS_LANGUAGE = AMERICAN
NLS_TERRITORY = AMERICA
NLS_CURRENCY = $
NLS_ISO_CURRENCY = AMERICA
NLS_NUMERIC_CHARACTERS = .,
NLS_CHARACTERSET = AL32UTF8
NLS_CALENDAR = GREGORIAN
NLS_DATE_FORMAT = DD-MON-RR
NLS_DATE_LANGUAGE = AMERICAN
NLS_SORT = BINARY
NLS_TIME_FORMAT = HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT = DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT = HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT = DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY = $
NLS_COMP = BINARY
NLS_LENGTH_SEMANTICS = CHAR
NLS_NCHAR_CONV_EXCP = FALSE
NLS_NCHAR_CHARACTERSET = AL16UTF16
NLS_RDBMS_VERSION = 11.2.0.1.0
It seems we've found the solution. After re-generation of the model with actual version everything works as expected. The problem is how the generator generated the edmx file. Our property causing the problems was with unicode="true" and now it is "false".
The change seems to be in the version 6.10.
The change seems to be in the version 6.10.
My opinion is there was some kind of an error in ver. 5.70.
For non-unicode columns (char in our case) there was unicode = "true" in the generated edmx file. Becuse the sql query generated from our linq query didn't contain any calls to to_nchar(), this was not of a problem. Everything worked well. But it seems that ver 6.10 changed the generation of the same linq query and now it contains call(s) to to_nchar() which is causing the problems.
I would say NLS_CHARACTERSET is not what matters here, the important thing is whether the column is unicode column (nchar, nvarchar...)
Can anyone from devart team confirm this theory?
Thank you
For non-unicode columns (char in our case) there was unicode = "true" in the generated edmx file. Becuse the sql query generated from our linq query didn't contain any calls to to_nchar(), this was not of a problem. Everything worked well. But it seems that ver 6.10 changed the generation of the same linq query and now it contains call(s) to to_nchar() which is causing the problems.
I would say NLS_CHARACTERSET is not what matters here, the important thing is whether the column is unicode column (nchar, nvarchar...)
Can anyone from devart team confirm this theory?
Thank you
aldare,
zmeskal has already sent us the DDL script of your VKLADY_OWNER schema. Assuming that we created a model from your database, please post here a test Entity SQL or LINQ query that generates erroneous SQL with dotConnect for Oracle v 6.30.160. Otherwise, send us a small complete test project to reproduce the problem in our environment.
Best regards
zmeskal has already sent us the DDL script of your VKLADY_OWNER schema. Assuming that we created a model from your database, please post here a test Entity SQL or LINQ query that generates erroneous SQL with dotConnect for Oracle v 6.30.160. Otherwise, send us a small complete test project to reproduce the problem in our environment.
Best regards
Ran Into Same Issue
I ran into the same issue, however when I set the Unicode property to false, it fixed the problem.
Re: Ran Into Same Issue
Thanks for info. Can I set unicode=false for column type NCHAR, NCLOB, NVARCHAR, ... in database with Encoding UTF-8?yensid21 wrote:I ran into the same issue, however when I set the Unicode property to false, it fixed the problem.