Invalid SQL statement when using FromSql

Invalid SQL statement when using FromSql

Postby ra-cap » Thu 13 Apr 2017 17:35

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?
ra-cap
 
Posts: 2
Joined: Thu 13 Apr 2017 17:26

Re: Invalid SQL statement when using FromSql

Postby Shalex » Fri 14 Apr 2017 12:47

https://www.devart.com/dotconnect/oracle/revision_history.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.
Shalex
Devart Team
 
Posts: 7539
Joined: Thu 14 Aug 2008 12:44

Re: Invalid SQL statement when using FromSql

Postby ra-cap » Mon 17 Apr 2017 21:18

Upgrading to 9.3.230 fixed the problem.
Thanks!
ra-cap
 
Posts: 2
Joined: Thu 13 Apr 2017 17:26


Return to dotConnect for Oracle