linqConnect for oracle producing invalid SQL
Posted: Mon 16 Jan 2012 17:36
Using dotConnect for Oracle and linqConnect, the following linq:
Produced a sql statement like this:
This is invalid and causes:
Code: Select all
context.MyTable.OrderBy(x.Col1).Select(x.Col1 + ":" + x.Col1).Distinct()
Code: Select all
SELECT DISTINCT t1."Col1" || ':' || t1."Col1" AS c1
FROM my_schema.MyTable t1
ORDER BY t1."Col1"
;
Entity developer version 3.50.134[/quote]ORA-01791 not a SELECTed expression
Cause: There is an incorrect ORDER BY item. The query is a SELECT DISTINCT query with an ORDER BY clause. In this context, all ORDER BY items must be constants, SELECT list expressions, or expressions whose operands are constants or SELECT list expressions.
Action: Remove the inappropriate ORDER BY item from the SELECT list and retry the statement.