I'm working with PLJSON and ORACLE ,I have a JSON like this
{
"DATA": {
"FROM_DATA": [
{
"COL": "",
"ROW": "",
"GET_DATA": [{"0":"df"}],
"SAVE_DATE": [{"2":"ar"}]
}
]
}
}
I'm able to parse FROM_DATA and get COL and ROW value but I can't parse GET_DATA and SAVE_DATA array.
This is my code :
objet_json :=json(i_json.get('DATA'));
JSONDATA:= json_list(objet_json.get('FROM_DATA'));
JSONGETDATA:= json_list(objet_json .get('GET_DATA')); (1)
JSONSAVEDATA:= json_list(objet_json .get('SAVE_DATE')); (2)
But I got an error on (1) and (2) :
ora-30625 method dispatch on null self argument is disallowed
DATA.FROM_DATAis an array containing a single element; it is not an object.Looking at the examples in the PLJSON git repository, you need to use
.get(1)to get the first element of the array:(Note: the objects/packages have the
plprefix as db<>fiddle does not allow creating synonyms; you should be able to remove those prefixes if your implementation has the appropriate synonyms created.)outputs:
db<>fiddle here