What is the JSON function in 12c?

283 views Asked by At

What is the JSON function in 12c?

SQL> SELECT JSON('{"foo":3,"bar":[1,2,3,4]}') J from dual;

         J
----------


SQL>

There is no JSON object in DBA_OBJECTS and there is no mention of this function in the SQL Language Reference manual.

What kind of a mystery I have met? An undocumented function?

1

There are 1 answers

0
APC On

The latest version of Oracle 12c has native support for JSON. For reasons that are (almost) obvious it is documented in the XML Developer's Guide (even though the Oracle implementation uses CLOBs to store JSON not XMLType). Find out more.

There is no JSON() function in Oracle 12c R1. However, there is a JSON_QUERY(), JSON_VALUE() and JSON_TABLE(). These are all in the latest version of the SQL Reference.

So what is your JSON() function? I'm going to guess it's the underlying implementation for one or more of the functions I listed above. Not sure why it doesn't appear in DBA_OBJECTS. If you have access, check out the script which creates the JSON objects: {$ORACLE_HOME}/rdbms/admin/catjsonv.sql (I don't have a 12c install to hand right now).