Define a format for binary input JSON ORACLE code example

Example 1: Oracle Store procedure error handling json file

DECLARE
   CURSOR species_cur
   IS
      SELECT id, sp.info
        FROM json_species sp;
 
   l_info              json_element_t;
   l_document_object   json_object_t;
   l_name              json_element_t;
BEGIN
   FOR rec IN species_cur
   LOOP
      l_info := json_element_t.parse (rec.info);
      l_document_object := TREAT (l_info AS json_object_t);
      l_name := l_document_object.get ('name');
 
      dbms_output.put_line (l_name.to_string);
   end loop;
END;
/

Example 2: SQL Developer store procedure insert json file to blob

CopyINSERT INTO my_table (json_doc)
  VALUES (UTL_RAW.convert(UTL_RAW.cast_to_raw('{....}'),
                          'AL32UTF8',
                          'WE8MSWIN1252'));