.net entity framrwork oracle select distinct issue

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
itsbpk
Posts: 1
Joined: Thu 22 Sep 2011 15:02

.net entity framrwork oracle select distinct issue

Post by itsbpk » Thu 22 Sep 2011 15:10

I'm trying to select top 100 from distinct set of column values. The query being generated is as follows

SELECT
"Limit1".CATEGORY_NM AS CATEGORY_NM
FROM ( SELECT DISTINCT
"Extent2".CATEGORY_NM AS CATEGORY_NM
FROM PROJECTITEM "Extent1"
LEFT OUTER JOIN CATEGORY "Extent2" ON "Extent1".CATEGORY_ID = "Extent2".CATEGORY_ID
WHERE ("Extent1".PROJECT_ID = 8070) AND ROWNUM <= 100
) "Limit1"

this entity framework query is as follows query.Select(select).Distinct().Take(100).ToList()

the part related to ROWNUM <= 100 should be part of the outer query. Any work around for this ?

I'm using .net entity framework with dot connect for oracle.

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

Post by Shalex » Fri 23 Sep 2011 15:55

Thank you for your report. We will investigate the situation and try to fix it. We will post here about the results.
Here is a workaround:

Code: Select all

.Select(a => a.SomeValue)
.Distinct()
.Take(100)
=>

Code: Select all

.Select(a => a.SomeValue)
.Distinct()
.OrderBy(a => a)
.Take(100)

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

Post by Shalex » Thu 29 Sep 2011 16:38

The bug with using Distinct and Take simultaneously in Linq to Entities is fixed. We will post here when the corresponding public build of dotConnect for Oracle is available for download.

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

Post by Shalex » Tue 25 Oct 2011 08:03

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

Post Reply