Invalid SQL statement when using FromSql

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
ra-cap
Posts: 2
Joined: Thu 13 Apr 2017 17:26

Invalid SQL statement when using FromSql

Post by 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?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Invalid SQL statement when using FromSql

Post by Shalex » Fri 14 Apr 2017 12:47

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.

ra-cap
Posts: 2
Joined: Thu 13 Apr 2017 17:26

Re: Invalid SQL statement when using FromSql

Post by ra-cap » Mon 17 Apr 2017 21:18

Upgrading to 9.3.230 fixed the problem.
Thanks!

Post Reply