title: How to use PL/JSON to parse array data
body: <p>I am just starting to use PL/JSON and I am able to parse non-array data, such as first name, for example:</p>
  
  <pre><code>json_ext.get_string (json (l_list.get (i)), 'firstName');
  </code></pre>
  
  <p>However I can't figure out how to parse array data such as addresses, for example:</p>
  
  <pre><code>street1 := json_ext.get_string (json (l_list.get (i)), 'addresses.street1'); 
  </code></pre>
  
  <p>does not work.</p>
  
  <p>How would I correctly parse array data, using:</p>
  
  <pre><code>street1 := json_ext.get_string (json (l_list.get (i)), 'addresses.street1');
  </code></pre>
  
  <p>using as an example?</p>
  
  <p>Here is an example of the JSON:</p>
  
  <pre><code>[
    {
  
  "firstName": "Edward",   
  "middleName": "Wolfgang",
  "lastName": "Munster",    
  "addresses": [
    {       
      "city": "",
      "addressType": "home",
      "state": "CA",
      "street1": "1313 Mockingbird Lane",
      "street2": ""
    },
    {        
      "city": "",
      "addressType": "business",
      "state": "CA",
      "street1": "123 Morgan Rd.",
      "street2": ""
    }
  ],  
  }
  </code></pre>
  
  <p>Here is the an example of the code I am using:</p>
  
  <pre><code>BEGIN
     SELECT json          
     INTO l_json
     FROM json_table
     WHERE id = 1;
      EXCEPTION
          WHEN NO_DATA_FOUND
          THEN
              l_json := NULL;
      END;
  
  
  l_list := json_list (l_json);
  
  FOR i IN 1 .. l_list.COUNT
  LOOP
  --These parse correctly      
    firstname := json_ext.get_string (json (l_list.get (i)), 'firstName');        
    middlename := json_ext.get_string (json (l_list.get (i)), 'middleName');
    lastname := json_ext.get_string (json (l_list.get (i)), 'lastName');      
  
  --These do not parse at all  
    addresstype :=  json_ext.get_string (json (l_list.get (i)), 'addresses.addressType');     
    street1 := json_ext.get_string (json (l_list.get (i)), 'addresses.street1');
    street2 := json_ext.get_string (json (l_list.get (i)), 'addresses.street2');
    city := json_ext.get_string (json (l_list.get (i)), 'addresses.city');
    state := json_ext.get_string (json (l_list.get (i)), 'addresses.state');
  </code></pre>