Page 1 of 1

ORA-00936: missing expression on 9.6.630 in Subselect

Posted: Fri 16 Nov 2018 08:42
by erolg
Hi,

the ef core linq expression

Code: Select all

 dbContext.Class1.Where(three =>
   !dbContext.Class1
     .Where(o => o.Test || o.Value < 5)
     .Select(o => o.ParentId)
     .Contains(three.Id)
   )
results to the generated sql

Code: Select all

SELECT "three"."Id", "three"."ParentId", "three"."Test", "three"."Value"
  FROM "Class1" "three"
  WHERE "three"."Id" NOT IN SELECT "o"."ParentId"
    FROM "Class1" "o"
    WHERE ("o"."Test" = 1) OR ("o"."Value" < 5)
which throws the error "ORA-00936: missing expression". There are brackets missing around the subselect.


SQL

WHERE "three"."Id" NOT IN SELECT ... FROM ... WHERE ...

should be

WHERE "three"."Id" NOT IN (SELECT ... FROM ... WHERE ...)

Democode can be downloaded here

Re: ORA-00936: missing expression on 9.6.630 in Subselect

Posted: Fri 16 Nov 2018 19:43
by Shalex
Thank you for your report. We have reproduced the issue and will notify you when it is fixed.

Re: ORA-00936: missing expression on 9.6.630 in Subselect

Posted: Thu 29 Nov 2018 13:34
by Shalex
The bug with generating a subquery within the IN clause in EF Core 2 is fixed: viewtopic.php?f=1&t=38123.