Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

'ORA-00904: "t"."Value": invalid identifier' using SQLQuery and .Single()

user-didq2Jun 8 2023

Very simple:

var maxID = dbCon.Database.SqlQuery<decimal>($"select max(id) from MY_TABLE").Single();

Throws:

Oracle.ManagedDataAccess.Client.OracleException
HResult=0x80004005
Message=ORA-00904: "t"."Value": invalid identifier
Source=Oracle Data Provider for .NET, Managed Driver
StackTrace: (left out)
The SQL Generated is - which throws the same error in TOAD:

SELECT "t"."Value"
FROM (
select max(id) from MY_TABLE
) "t"
FETCH FIRST 2 ROWS ONLY

Versions of Stuff:

Oracle RDBMS: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0

This post has been answered by Alex Keh-Oracle on Jun 9 2023
Jump to Answer

Comments

Processing

Post Details

Added on Jun 8 2023
4 comments
1,738 views