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

JSON Data Management
-- Oracle 19c: JSON Data Management 
-- Parse JSON data, validate and add new elements

SET SERVEROUTPUT ON;

DECLARE
 jelmt  JSON_ELEMENT_T;
 jobj   JSON_OBJECT_T;

BEGIN
 jelmt := JSON_ELEMENT_T.parse('{"Type": "Galaxy"}'); 

 IF (jelmt.is_object) THEN
   jobj := treat(jelmt AS JSON_OBJECT_T);
   jobj.put('Name', 'Milky Way');
   jobj.put('Diameter (ly)', '120,000');
   jobj.put('Star', 'Sun');
 END IF;

 DBMS_OUTPUT.PUT_LINE(jelmt.to_String);
 --Individual value
 DBMS_OUTPUT.PUT_LINE('Type: '||jobj.get_string('Type')); 
END;
/


  Oracle 19c Index   Get JSON Data   Get_Keys

  Lower Versions   11g Index   12c Index

Oracle registered trademark of Oracle Corporation.

Last Revised On: December 27th, 2021

  4327