title: PL/SQL APEX_JSON how to parse to CLOB variable
body: <p>I'm trying to parse a json object like this one:</p>
  <pre><code>{
    &quot;sites&quot;: [
      {
        &quot;code&quot;: &quot;code&quot;,
        &quot;siteName&quot;: &quot;site name&quot;,
        &quot;country&quot;: &quot;country&quot;,
        &quot;arrayToClob&quot;: [
          {
            &quot;field1&quot;: &quot;field 1&quot;,
            &quot;field2&quot;: &quot;field 2&quot;
          }
        ]
      }
    ]
  }
  </code></pre>
  <p>and I want to store the value of &quot;arrayToClob&quot; element into a Clob column of my DB and for that I'm trying to get the value of that element as a whole. This is what I tried:</p>
  <pre><code>APEX_JSON.parse(MY_JSON);
  l_count := APEX_JSON.get_count('sites');
  FOR i IN 1 .. l_count LOOP
      l_code := APEX_JSON.get_varchar2('sites[%d].code', i);
      l_siteName := APEX_JSON.get_varchar2('sites[%d].siteName', i);
      l_country := APEX_JSON.get_varchar2('sites[%d].country', i);
      l_value := APEX_JSON.get_array('sites[%d].arrayToClob', i);
   END LOOP;
  </code></pre>
  <p>where <code>l_value</code> is type <code>json_array_t</code>... but of course is not working. I've tried also with <code>varchar2</code> type and I've check other options here <a href="https://docs.oracle.com/cd/E59726_01/doc.50/e39149/apex_json.htm#AEAPI29655" rel="nofollow noreferrer">https://docs.oracle.com/cd/E59726_01/doc.50/e39149/apex_json.htm#AEAPI29655</a></p>
  <p>I don't know how to approach it, I don't know if it's even possible what I want... any tips will be welcome.</p>
  <p>Thanks in advance</p>