26.52 WRITE Procedure Signature 17

This procedure writes parts of a parsed APEX_JSON.t_values table as an object member attribute.


    p_name             IN VARCHAR2,
    p_values           IN t_values,
    p_path             IN VARCHAR2 DEFAULT '.',
    p0                 IN VARCHAR2 DEFAULT NULL,
    p1                 IN VARCHAR2 DEFAULT NULL,
    p2                 IN VARCHAR2 DEFAULT NULL,
    p3                 IN VARCHAR2 DEFAULT NULL,
    p4                 IN VARCHAR2 DEFAULT NULL,
    p_write_null       IN BOOLEAN  DEFAULT FALSE ); 


Table 26-65 WRITE Procedure Parameters

Parameter Description
p_name The attribute name.
p_values The parsed JSON members.
p_path The index into p_values.
p[0-4] Each %N in p_path will be replaced by pN and every i-th %s or %d is replaced by p[i-1].
p_write_null If true, write NULL values. If false (the default), do not write NULLs.


This example parses a JSON string and writes parts of it as an object member.

  j apex_json.t_values;
  apex_json.parse(j, '{ "foo": 3, "bar": { "x": 1, "y": 2 }}');
  apex_json.open_object; -- {
  apex_json.write('parsed-bar',j,'bar');-- "parsed-bar":{ "x":1 ,"y":2 }
  apex_json.close_object; -- }