ORA-00904: "TRUE": invalid identifier while using Contains

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

ORA-00904: "TRUE": invalid identifier while using Contains

Post by erolg » Mon 19 Aug 2019 13:20

Hi,

the ef core linq expression (using Devart.Data.Oracle.EFCore 9.7.805)

Code: Select all

var groups = new List<string> { "abc" };
dbContext.Class1
    .Select(one => new
    {
        one.Id,
        InGroup = groups.Contains(one.GroupName),
    })
    .ToList();
results to the generated sql

Code: Select all

SELECT "one"."Id", CASE
    WHEN False = True
    THEN 1 ELSE 0
END AS "InGroup"
FROM "Class1" "one"
which throws the error 'ORA-00904: "TRUE": invalid identifier'. The Contains-Statement is not resolved.

The part of the sql-statement which is

Code: Select all

WHEN False = True
should be

Code: Select all

WHEN "one"."GroupName" IN ('abc')
Democode can be downloaded here

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

Re: ORA-00904: "TRUE": invalid identifier while using Contains

Post by Shalex » Tue 20 Aug 2019 17:47

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

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

Re: ORA-00904: "TRUE": invalid identifier while using Contains

Post by Shalex » Thu 21 Nov 2019 20:12

The bug with using .Contains within .Select of LINQ query in EF Core 2 is fixed: viewtopic.php?f=1&t=39576.

Post Reply