Page 1 of 1

problem with Take on Query

Posted: Thu 24 Mar 2011 12:13
by wgkwvl
Hi,

I have following query :

var qry = context.patients.where(p=> X || Y); ( X and Y are some conditions ).

I want the query to return the first 51 rows,
so i return :
return qry.Take(51).ToList();

but the result is some 27000 records, because the generated sql is :
select ... from patientens where X or Y and rownum <= 51
instead of
select ... from patientens where (X or Y) and rownum <= 51

this does not seem correct behaviour to me .

greetings

Stijn

Posted: Thu 24 Mar 2011 12:16
by wgkwvl
Explicitly adding parentheses around my or statement does not solve the problem :
var qry = context.patients.where(p=> ( X || Y) ); ( X and Y are some conditions ).
return qry.Take(51).ToList();

the same sql is generated

Posted: Fri 25 Mar 2011 12:46
by AndreyR
Thank you for the report, I have reproduced the issue. We will let you know as soon as the problem is solved.

Posted: Mon 04 Apr 2011 16:41
by AndreyR
We have fixed this error. The fixed build will be available in a week or so.

Posted: Thu 07 Apr 2011 13:07
by AndreyR
The new build of dotConnect for Oracle 6.10.135 is available for download now. This build fixes the problem.
It can be downloaded from Download Page (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to this post.