Search code examples
jsonplsqlplsqldeveloperpljson

PL/JSON get both the value and the parameter in json list


I need to get both the value and the parameter in a json list using pl/json library. For an example,

{TABLE:"TEST",Parameters:[{"PID":"bar"},{"PFOJ":"baz"},{"PCLI":"bar"}]}

I need to get the parameter and the corresponding value in the 'Prameters' list in this json object like,

param varchar2(20);
value varchar2(20);

param := get_param(1); //from Parameters list
value := get_value(1); //from Parameters list

Thank you!


Solution

  • You need to get the key name:

    varchar2 key := parameter_obj.get_keys.get(1).get_string();