Page 1 of 1

generated SQL not using index

Posted: Thu 10 Mar 2011 17:11
by wgkwvl
Hi,

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 :
SELECT *
FROM AFDA.AFDA_VRGESCHR_ZORGEN "Extent1"
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 ?

greetings

Stijn

Posted: Fri 11 Mar 2011 10:23
by wgkwvl
Could i fix this with numbermappings ?
http://www.devart.com/forums/viewtopic.php?t=19402

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:
http://www.devart.com/forums/viewtopic. ... ermappings
but i havent found any documentation how to specify this in the connection string ? any help ?

Stijn

Posted: Fri 11 Mar 2011 12:54
by AndreyR
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.