Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

APEX_JSON.WRITE to update attribute

Sergio VegaSep 2 2019 — edited Sep 2 2019

Hi,

I have Oracle 11g and would like to update an attribute of a JSON using APEX_JSON.WRITE (procedure signature 15):

DECLARE

  j apex_json.t_values;

BEGIN

  apex_json.parse(j, '{"foo":3}');

  dbms_output.put_line('foo is '||apex_json.get_number(p_path => 'foo', p_values => j));

  apex_json.write(p_values => j, p_path  => 'foo', p0 => 4);

  dbms_output.put_line('New foo value is '||apex_json.get_number(p_path => 'foo', p_values => j));

END;

I expected to have a new JSON with foo:4, but unfortunately it remains as foo:3.

Any idea?

Thanks,

Sergio

Comments
Post Details
Added on Sep 2 2019
2 comments
724 views