I was wondering if anyone previously has added a request for accepting JSON arrays at the root level, e.g.
select json('') from dual;
This is valid JSON but returns "ORA-20101: JSON Parser exception - no { start found" which seems to imply the parser only accepts outer braces on any incoming document.
Note my usage case is accepting JSON responses from Neo4j.
Thanks,
Paul
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
select json_list('[{"bub":1},{"foo":2}]') from dual;
It looks like what you were doing was using json_parser.parser to convert the string. This function does expect the input string to represent a top level object and not an array. I think the easiest solution is to look at the first character of the incoming string to decide which parser to use - json() or json_list().
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi folks,
I was wondering if anyone previously has added a request for accepting JSON arrays at the root level, e.g.
select json('') from dual;
This is valid JSON but returns "ORA-20101: JSON Parser exception - no { start found" which seems to imply the parser only accepts outer braces on any incoming document.
Note my usage case is accepting JSON responses from Neo4j.
Thanks,
Paul
Try this instead:
It looks like what you were doing was using json_parser.parser to convert the string. This function does expect the input string to represent a top level object and not an array. I think the easiest solution is to look at the first character of the incoming string to decide which parser to use - json() or json_list().