Page 1 of 1

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

Posted: Mon 19 Aug 2019 13:20
by erolg
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

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

Posted: Tue 20 Aug 2019 17:47
by Shalex
Thank you for your report. We have reproduced the issue and will notify you when it is fixed.

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

Posted: Thu 21 Nov 2019 20:12
by Shalex
The bug with using .Contains within .Select of LINQ query in EF Core 2 is fixed: viewtopic.php?f=1&t=39576.