generated SQL not using index

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Posts: 39
Joined: Tue 20 Jul 2010 15:13

generated SQL not using index

Post by wgkwvl » Thu 10 Mar 2011 17:11


I have a table for which the primary key is Number(19,0)
( on Oracle).
The key in the model is mapped to int64 ( in conceptual and storage layer).

When i make a query, the gererated sql looks like :
WHERE ( CAST("Extent1".PATIENT_NR AS NUMBER)) = 15505;

So the SQL casts the key as number even when it is already a number.
This makes it so that my index on 'PATIENT_NR' is not used.

I Map the Property to INT64 becus i want to use long in code instead of decimal !

Is there anything i can do to fix this mapping problem ?



Posts: 39
Joined: Tue 20 Jul 2010 15:13

Post by wgkwvl » Fri 11 Mar 2011 10:23

Could i fix this with numbermappings ?

but i am not working with datareaders, i am working with Entity framework, and my context.connection does not have a numbermappings
property so i will probably have to cast it to oracle connection ?
-> yeps, that worked,
still :
an easier way for me would be the connection string: ... ermappings
but i havent found any documentation how to specify this in the connection string ? any help ?


Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 11 Mar 2011 12:54

We have fixed similar error in the latest build. It can be downloaded from here (the trial version) or from Registered Users' Area (for users with active subscription only).
Detailed information about the fixes and improvements available in dotConnect for Oracle 6.10.121 is available here.

Post Reply