When using efcore 1.0.1 and dotconnect 9.2.187 the generated SQL from using FromSql followed by an include generates a table alias for the subquery using the keyword AS. Take for example:
sql:
"select * from search where id in ({0}, {1})"
this.context.SEARCH.FromSql(sql, 1,2).Include(search => search.person);
generates the following sql:
SELECT "c".ID, "c".DATE, "c0".ID, "c0".NAME,
FROM (
select * from search where id in ({0}, {1})
) AS "c"
LEFT JOIN PERSON "c0" ON "c".ID = "c0".ID
not exact tables/sql for brevity but example is valid.
Would an upgrade to a newer version of devart solve the problem or is this a bug?
Invalid SQL statement when using FromSql
Re: Invalid SQL statement when using FromSql
https://www.devart.com/dotconnect/oracl ... story.html
9.2.205 09-Feb-17
The bug with using the .FromSql() functionality in EF Core is fixed
Please upgrade to the newest (9.3.230) build and notify us about the result.
9.2.205 09-Feb-17
The bug with using the .FromSql() functionality in EF Core is fixed
Please upgrade to the newest (9.3.230) build and notify us about the result.
Re: Invalid SQL statement when using FromSql
Upgrading to 9.3.230 fixed the problem.
Thanks!
Thanks!