1 Reply Latest reply on Oct 25, 2019 7:28 AM by MaxOrgiyan-Oracle

    Manipulate JSON in a blob



      I have a table with json-data stored in a blob-column. Mostly the data is larger than 4000 char.

      Is there a way of updating values in the json structure in a blob-column? All examples I have seen are doing conversions to clob etc.

      When looking at JSON_OBJECT_T and JSON_ELEMENT_T there is a function put but the examples never seem to use

      data from fields in the database.


      I tried this:

      set serveroutput on;


      jo JSON_OBJECT_T;

      json_data blob;



      select load_data into json_data from load_pos where pos_id like '%TestUlrika22%' and load_dt='2019-09-16 11:29:36,609521000';

          jo := new JSON_OBJECT_T(json_data);

          jo.put('storeCode', '11111');


      --    update load_pos

      --    set load_data=to_blob(jo)

      --    where load_dt='2019-09-16 11:29:36,609521000';



      And I got an extra storeCode at the end instead of updating the present one.





      Also how do I convert the JSON_OBJECT_T back to blob to be able to update the table?


      Thanks and Best Regards