Problem with comparision of char fields

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
voehri
Posts: 2
Joined: Thu 12 Jul 2012 12:27

Problem with comparision of char fields

Post by voehri » Thu 12 Jul 2012 13:45

If we execute the following linq query with dotConnect for oracle v.7.0.25.0 we get an empty result. With previous versions there were no problems.

Code: Select all

var entities = from entity in context.TESTVIEW
               where entity.STATE == criteria.State
               select entity;
type of entity.STATE is String
type of criteria.State is String
value of criteria.State is "A"
connection string contains Unicode = true

The field STATE in database view TESTVIEW is defined as Char.

DbMonitor shows that the generated sql statement is equal with the generated sql statement of previous versions.

Code: Select all

SELECT 
1 AS C1,
"Extent1".DESIGNER,
"Extent1".INFO,
"Extent1".SPKEY,
"Extent1".STATE
FROM (SELECT 
      TESTVIEW.DESIGNER,
      TESTVIEW.INFO,
      TESTVIEW.SPKEY,
      TESTVIEW.STATE
      FROM TESTVIEW) "Extent1"
WHERE :p__linq__0 = "Extent1".STATE
The curious thing is if we change the order of parameters in the where clause we get a result:

Code: Select all

var entities = (from entity in context.TESTVIEW
                where criteria.State == entity.STATE
                select entity);
DbMonitor shows that now the p__linq__0 parameter is of type VarChar instead of Char.


Why the order in the where clause is important now or is it a bug?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Problem with comparision of char fields

Post by Shalex » Tue 17 Jul 2012 17:34

We have reproduced the issue with comparing char fields when the "Unicode=true;" connection string parameter is used. We will investigate it and notify you about the results as soon as possible.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Problem with comparision of char fields

Post by Shalex » Wed 25 Jul 2012 13:32

The bug with comparing char fields in the non-unicode mode is fixed. We are investigating the issue with comparing char fields in the unicode mode. We will post here when the new build of dotConnect for Oracle is available for download.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Problem with comparision of char fields

Post by Shalex » Fri 03 Aug 2012 08:52

The bug with the OracleDbType.Char command parameter when using the "Unicode=true;" connection string parameter in the Direct Mode is fixed. We will post here when the corresponding build of dotConnect for Oracle is available for download.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Problem with comparision of char fields

Post by Shalex » Thu 09 Aug 2012 16:40

New build of dotConnect for Oracle 7.1.58 is available for download!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=24670 .

voehri
Posts: 2
Joined: Thu 12 Jul 2012 12:27

Re: Problem with comparision of char fields

Post by voehri » Mon 13 Aug 2012 09:43

Thank you for new version. I've installed v7.1.58 but we still get no result. Now the order of the parameters doesn't matter.

If we execute the following linq statement

Code: Select all

var entities = from entity in context.TESTVIEW
               where entity.STATE == criteria.State
               select entity;
we see in DbMonitor that the parameter of generated sql statement is of type Char --> no result. If we execute the linq statement with Trim()

Code: Select all

var entities = from entity in context.TESTVIEW
               where entity.STATE == criteria.State.Trim()
               select entity;
the parameter of generated sql statement is of type VarChar --> result.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Problem with comparision of char fields

Post by Shalex » Thu 16 Aug 2012 16:13

We are investigating the issue with the OracleDbType.Char command parameter when using the "Unicode=true;" connection string parameter in the OCI Mode (via Oracle client). As a temporary workaround, please use the Direct Mode.

Post Reply