ORA-00936: missing expression on 9.6.630 in Subselect

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
erolg
Posts: 2
Joined: Mon 27 Aug 2018 05:34

ORA-00936: missing expression on 9.6.630 in Subselect

Post by erolg » Fri 16 Nov 2018 08:42

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

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

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

Post by Shalex » Fri 16 Nov 2018 19:43

Thank you for your report. We have reproduced the issue and will notify you when it is fixed.

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

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

Post by Shalex » Thu 29 Nov 2018 13:34

The bug with generating a subquery within the IN clause in EF Core 2 is fixed: viewtopic.php?f=1&t=38123.

Post Reply