Page 1 of 1

Error While executing LINQ query using dotConnect with Oracle.

Posted: Mon 28 Jul 2014 07:33
by sudhanshu
I am struggling with an error please help me ASAP,
Please find below details :-
While executing the the below mentioned query I am getting unnecessary error.
It is very simple query I can easily execute it in Oracle.
I am using Devart.Data.Oracle, Version=8.4.201.0

Exception : {"OUTER APPLY is not supported by Oracle Database 11g and lower. Oracle 12c or higher is required to run this LINQ statement correctly. If you need to run this statement with Oracle Database 11g or lower, rewrite it so that it can be converted to SQL, supported by the version of Oracle you use."}

My query : -

var cntx=new MyContext();
cntx.PROPERTies.Include(x=>x.PROPERTY_ADDRESS);
var prp = cntx.PROPERTies.Where(x => x.PROPERTY_STATUS == "A")
.Select(x => new
{
PropertyId = x.PROPERTY_ID,
PropertyAddress = x.PROPERTY_ADDRESS.FirstOrDefault(),
CreatedDate=x.CREATED_DATE
});
//Error occurred while executing below command.
var recordCount = prp.Count();

Re: Error While executing LINQ query using dotConnect with Oracle.

Posted: Tue 29 Jul 2014 09:53
by Shalex
sudhanshu wrote:It is very simple query I can easily execute it in Oracle.
You can find out the SQL statement which fails to execute via the dbMonitor tool:
http://www.devart.com/dotconnect/oracle ... nitor.html
http://www.devart.com/dbmonitor/dbmon3.exe
sudhanshu wrote:Exception : {"OUTER APPLY is not supported by Oracle Database 11g and lower. [...]
This is a limitation of Entity Framework which does not take into account the peculiarities of other databases which differ from SQL Server: http://social.msdn.microsoft.com/Forums ... 82a2177346.

The OUTER APPLY/CROSS APPLY constructions are supported by Oracle server starting from the 12c version. Our implementation in dotConnect for Oracle avoids generation of OUTER APPLY/CROSS APPLY if it is possible, but some LINQ queries cannot be translated without employing OUTER APPLY/CROSS APPLY. In this case you should rewrite your LINQ statement. Scenarios which lead to CROSS APPLY/OUTER APPLY are listed at http://forums.devart.com/viewtopic.php?t=23362.