Kayshav.com
About Developer Oracle 19c Oracle 12c Technology Information Sitemap

Parse JSON Text
-- Oracle 19c: Parse JSON text to get values  

SET SERVEROUTPUT ON;

DECLARE
 jobj   JSON_OBJECT_T;
 jobjn  JSON_OBJECT_T;

BEGIN
 jobj := JSON_OBJECT_T.parse('{msg:"Hello"}');
 jobj.On_error(1);

 jobjn := JSON_OBJECT_T.parse('{"Price":100.00}');
 jobjn.On_error(1);

 DBMS_OUTPUT.PUT_LINE(jobj.get_String('msg'));
 DBMS_OUTPUT.PUT_LINE(jobjn.get_Number('Price'));

 --This will result in error
 --DBMS_OUTPUT.PUT_LINE(jobj.get_Number('msg'));  
END;
/



  Oracle 19c Index

   WITH Function to process JSON

  Lower Versions   11g Index   12c Index

Oracle registered trademark of Oracle Corporation.

Last Revised On: January 27th, 2021

  4326