title: How to loop through a json response with PL/SQL?
body: <p>I am facing an issue when my json response is like this:</p>
  
  <pre><code>declare
  sample_json   varchar2 (32767)
          := '{"items": [{"NAME":"AUDI","YEAR":"2000"},{"NAME":"BMW","YEAR":"2010"}]}';
  BEGIN
  for rec IN (
       select j.name,j.year 
         from json_table(sample_json,'$[*]' COLUMNS 
          name varchar2(20) PATH '$.items[0].NAME',
          year NUMBER       PATH '$.items[0].YEAR'
         ) j  ) 
       LOOP
         dbms_output.put_line (rec.name||','||rec.year);
       END LOOP;
  END;
  /
  </code></pre>
  
  <p>I have to use $.items[0].NAME to get one value but i want to make it dynamic so that it can loop to give me both the values.</p>