Closed Xor-el closed 9 months ago
JSON is not currently supported in the Oracle EF Core 21.8 version. Oracle is planning to add this support soon.
This issue exists as a bug because the overarching enhancement has not been added. Bug 34989726 has been filed to track this issue. The parent enhancement request is https://github.com/oracle/dotnet-db-samples/issues/259.
ODP.NET 21c for EF Core 8 will support JSON columns. We've been investigating the reported JSON bugs in parallel. This bug appears to be a DB issue. We've created a separate DB bug (36000673) to track that issue, which we think will resolve the client side issue.
The ODP.NET issue (Bug 34989726) has been investigated and resolved. As such, I'm closing this issue.
The DB team will continue to work on resolving the DB server issue that remains: Bug 34989726.
The Oracle JSON dev team has concluded this bug cannot be fixed as the specific JSON syntax is not supported.
The workaround is to provide a string with an escaped Unicode character.
executing a query that utilizes Oracle Db JSON functions like
JSON_VALUE
generates the following SQL
which throws
ORA-40442: JSON path expression syntax error ('')
when run against the database.I think this affects all Oracle Db JSON functions that take a path. been able to reproduce it on
JSON_VALUE
,JSON_EXISTS
, andJSON_QUERY
.manually rewriting the generated SQL by removing the
N
before the JSON path'$.description'
allows the query to execute successfully.Workaround
I can work around this by rewriting the second parameter of the Db function in my OnModelCreating of DbContext when configuring the
HasDbFunction
for the specific Db Function as a constant string.Original code
Workaround code
Repro Project
https://github.com/Xor-el/EFCore-Oracle-Buggy-Demo/tree/db-function-json-path-parameter-bug
Provider and version information
EF Core version: Oracle.EntityFrameworkCore 7.21.8 Database provider: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Target framework: .NET 6.0 Operating system: Windows 10 IDE: Visual Studio 2022 17.4.3