ORA-00904 "Extent1"."SAMIDX"
ORA-00904 "Extent1"."SAMIDX"
Hi,
I've an error 904 with the query generated by devArt for a linq query such as :
var ar = "zeze".Split(' ');
Samples.Where (s => s.CatalogId == 21 && s.InnerType == 2 &&
s.LabelValues.Any(lv => lv.Label.Name.Equals("FamilyCode") && ar.Any(k => lv.InnerValue.Contains(k)))
).Count();
The generated sql is :
SELECT Count(1) AS A1
FROM SLESAMPLE "Extent1"
WHERE (("Extent1".CATIDX = 21) AND ("Extent1".SAMTYPE = 2)) AND ( EXISTS (SELECT
1 AS C1
FROM ( SELECT
"Extent2".LBVVALUE AS LBVVALUE,
"Extent3".LABNAME AS LABNAME
FROM SLELABVALUE "Extent2"
INNER JOIN SLELABEL "Extent3" ON "Extent2".LABIDX = "Extent3".LABIDX
WHERE "Extent1".SAMIDX = "Extent2".SAMIDX
) "Project1"
WHERE ("Project1".LABNAME = 'FamilyCode') AND ( EXISTS (SELECT
1 AS C1
FROM ( SELECT 1 FROM DUAL) "SingleRowTable1"
WHERE (INSTR("Project1".LBVVALUE, 'zeze')) > 0
))
))
on oracle 11.
I've a similar problem on mysql 5.5
I've found this in the FAQ : http://www.devart.com/dotconnect/oracle/faq.html#q118
But there is no workaround listed.
Is a correction scheduled ?
If not, what workaround can i use ? The linq query has to be the same for MsSql with microsoft provider & Oracle/Mysql with DevArt providers.
I can provide a little sample project if there is a way to upload.
My version of Devart is 6.30.172, i made a try with 6.60.283.0 but nothing has changed
Thanks.
CConnes
I've an error 904 with the query generated by devArt for a linq query such as :
var ar = "zeze".Split(' ');
Samples.Where (s => s.CatalogId == 21 && s.InnerType == 2 &&
s.LabelValues.Any(lv => lv.Label.Name.Equals("FamilyCode") && ar.Any(k => lv.InnerValue.Contains(k)))
).Count();
The generated sql is :
SELECT Count(1) AS A1
FROM SLESAMPLE "Extent1"
WHERE (("Extent1".CATIDX = 21) AND ("Extent1".SAMTYPE = 2)) AND ( EXISTS (SELECT
1 AS C1
FROM ( SELECT
"Extent2".LBVVALUE AS LBVVALUE,
"Extent3".LABNAME AS LABNAME
FROM SLELABVALUE "Extent2"
INNER JOIN SLELABEL "Extent3" ON "Extent2".LABIDX = "Extent3".LABIDX
WHERE "Extent1".SAMIDX = "Extent2".SAMIDX
) "Project1"
WHERE ("Project1".LABNAME = 'FamilyCode') AND ( EXISTS (SELECT
1 AS C1
FROM ( SELECT 1 FROM DUAL) "SingleRowTable1"
WHERE (INSTR("Project1".LBVVALUE, 'zeze')) > 0
))
))
on oracle 11.
I've a similar problem on mysql 5.5
I've found this in the FAQ : http://www.devart.com/dotconnect/oracle/faq.html#q118
But there is no workaround listed.
Is a correction scheduled ?
If not, what workaround can i use ? The linq query has to be the same for MsSql with microsoft provider & Oracle/Mysql with DevArt providers.
I can provide a little sample project if there is a way to upload.
My version of Devart is 6.30.172, i made a try with 6.60.283.0 but nothing has changed
Thanks.
CConnes
The only workaround is to reconstruct the query to avoid the situation which is described at http://www.devart.com/dotconnect/oracle/faq.html#q118.
1. Try using more optimal LINQ to Entities query which produces smaller, faster SQL without OUTER APPLY:
instead of
You can change the query for MySQL correspondingly.
2. Usage of SQL Server, MySQL, and Oracle simultaneously in one application can be implemented in the following three alternative ways:
2.1. Creating repositories for 3 models
2.2. Using mapping which is loaded dynamically:
2.2.1. With 3 *.edmx. Only one of them generates the code of model and entity classes, others two are used as sources of XML resources (example: http://www.devart.com/efquerysamples.zip)
2.2.2. Only one model and database independent fluent mapping: http://www.devart.com/blogs/dotconnect/ ... plate.html
Code: Select all
static Expression> queryOracle = s => s.CATIDX == 21 && s.SAMTYPE== 2 &&
s.SLELABVALUE.Any(lv => lv.SLELABEL.LABNAME.Equals("FamilyCode") && ar.Contains(lv.LBVVALUE));
Code: Select all
static Expression> queryOracle = s => s.CATIDX == 21 && s.SAMTYPE== 2 &&
s.SLELABVALUE.Any(lv => lv.SLELABEL.LABNAME.Equals("FamilyCode") && ar.Any(k => lv.LBVVALUE.Contains(k)));
2. Usage of SQL Server, MySQL, and Oracle simultaneously in one application can be implemented in the following three alternative ways:
2.1. Creating repositories for 3 models
2.2. Using mapping which is loaded dynamically:
2.2.1. With 3 *.edmx. Only one of them generates the code of model and entity classes, others two are used as sources of XML resources (example: http://www.devart.com/efquerysamples.zip)
2.2.2. Only one model and database independent fluent mapping: http://www.devart.com/blogs/dotconnect/ ... plate.html
Hi Shalex,
For the point 1 : sorry but the two expressions are not equivalent : they do not produce the same result :
var ar = "abc cde fgh".Split();
var lbvvalue = "wxc qsd cde";
ar.Any (k => lbvvalue.Contains(k)) != ar.Contains(lbvvalue);
for the 2 point: thanks but as i wrote it in the file, this is already done but i didn't report it in the test project to keep it simple
For the point 1 : sorry but the two expressions are not equivalent : they do not produce the same result :
var ar = "abc cde fgh".Split();
var lbvvalue = "wxc qsd cde";
ar.Any (k => lbvvalue.Contains(k)) != ar.Contains(lbvvalue);
for the 2 point: thanks but as i wrote it in the file, this is already done but i didn't report it in the test project to keep it simple