title: How do I query for non-scalar JSON values in PL/SQL
body: <p>I have the following JSON input:</p>
  <pre><code>[{a:1}, {a:2}]
  </code></pre>
  <p>I want the following tabular output (a single varchar2 column / two rows):</p>
  <pre><code>{a:1}
  {a:2}
  </code></pre>
  <p>I tried:</p>
  <pre><code>select * from json_table(
     '[{a:1}, {a:2}]',
     '$[*]'
     error on error
     columns xxx varchar2 path '$'
  );
  </code></pre>
  <p>I get:</p>
  <pre><code>ORA-40456: JSON_VALUE evaluated to non-scalar value
  </code></pre>
  <p>How do I query those non-scalar JSON values such as '{a:1}' in their entirety in PL/SQL? I understand that JSON_QUERY is the non-scalar counterpart to JSON_VALUE, but I'm not using JSON_VALUE explicitly, so I don't know where I would plug in JSON_QUERY in this query.</p>
  <p>(In real life, those JSON values in the initial array will be complex structures, so I don't want to parse them all the way down to their scalar components and then piece them together again).</p>
  <p>I use Oracle 18.1</p>