I have a table "EvMetadata" with column "Metadata" that has a check constraint of "IS JSON". Note that the table and its columns are created with DOUBLE QUOTES by design.
Following SQL works where I'm not specifying any JSON work to be done by Oracle.
select
m."Metadata"
from "EvMetadata" m
As you can see below, the Metadata column simply displays its content which happens to be JSON data.
However, I get error if I were to issue a json query as follows.
select
m."Metadata"."FileName"
from "EvMetadata" m
I just added "FileName" using dot notation. As you can see above, "FileName" is a valid json field. So why the error?
Error is
ORA-00904: "M"."Metadata"."FileName": invalid identifier 00904. 00000 - "%s: invalid identifier" *Cause: *Action: Error at Line: 2 Column: 3
Could this be a bug with Oracle's JSON query support using the dot notation under a specific scenario where database objects are declared with double quotes? The reason I suspect that may be true is that the following equivalent query, not using the dot notation, works.
select
JSON_VALUE(m."Metadata", '$.FileName')
from "EvMetadata" m

select m.Metadata.FileName from "EvMetadata" mI've only seen dot notation work without the quotes around the fields and I imagine that the mixed-case requiring quotes is complicating the execution. - leroyJr