Janitha Madushan
Janitha Madushan

Reputation: 1543

PL/JSON get json inside a json object

I need to get a json object inside a joson object using PL/JSON. For an example,

json_obj1 json := json('{"ProcessParameters":{"foo":"bar","bar":"baz"}}');

I need to get 'ProcessParameters' object to another object. like,

json_obj2 json := get_json_object(json_obj1,'ProcessParameters');

Thank you!

Upvotes: 1

Views: 1077

Answers (1)

Janitha Madushan
Janitha Madushan

Reputation: 1543

I found the answer,

DECLARE
    obj json := json();
    json_object json;

BEGIN
    obj := json('{"value":{"weight":"spots","Invalid spots":"Invalid"}}');
    json_object := JSON_EXT.GET_JSON(obj,'value');

END;

Upvotes: 3

Related Questions