JSON_VALUE UDF
Translation reference to convert Oracle JSON_VALUE function to Snowflake
Last updated
Translation reference to convert Oracle JSON_VALUE function to Snowflake
Last updated
As per Oracle's documentation, this function uses the to request information about a portion of a JSON instance. The returning value is always a scalar value, else the function returns NULL
by default.
The JSON_VALUE_UDF is a Snowflake implementation of the JSONPath specification that uses a modified version of the original JavaScript implementation developed by .
Run these queries to run queries in the JSON_VALUE Patterns section.
Now, the only supported types when translating the functionality of the RETURNING TYPE clause are VARCHAR2
, CLOB
and NUMBER
.
For all the other types supported by the original JSON_VALUE function, the JSON_VALUE_UDF will behave as if no RETURNING TYPE clause was specified.
Unsupported types:
DATE
TIMESTAMP [WITH TIME ZONE]
SDO_GEOMETRY
CUSTOM TYPE
Now, the ON MISMATCH clause is not supported, and a warning EWI is placed instead. Thus, the translated code will behave as if no ON MISMATCH clause was originally specified.
Complex filters with more than one expression will return null as they are not supported.
For example, with the same data as before, this JSON path $.store.book[*]?(@.category == "reference").title
is supported and will return 'Sayings of the Century'
.
However, $.store.book[*]?(@.category == "reference" && @.price < 10).title
will return null
since more than one expression is used in the filter.
: Not supported in Snowflake.