title: How to "flatten" the structure with the TABLE expression
body: <p>I have a VARRAYS TYPE  wanted to "flatten" the structure with the TABLE expression.</p>
  
  <p>The example data</p>
  
  <pre><code>CREATE OR REPLACE TYPE ARIS.NUMBER_VARRAY_5 AS VARRAY (5) OF NUMBER NOT NULL;  
  
  
  CREATE TABLE ARIS.TEST_2  
  (  
    DATE_START  DATE,  
    DATE_END    DATE,  
    O3          ARIS.NUMBER_VARRAY_5,  
    CATEGORY    NUMBER  
  )  
  
  
  SET DEFINE OFF;  
  Insert into TEST_2  
     (DATE_START, DATE_END, O3, CATEGORY)  
   Values  
     (TO_DATE('01/01/2005 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/05/2005 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NUMBER_VARRAY_5(281.25,-9999,291.5,310.5,298.75), NULL);  
  Insert into TEST_2  
     (DATE_START, DATE_END, O3, CATEGORY)  
   Values  
     (TO_DATE('01/02/2005 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/06/2005 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NUMBER_VARRAY_5(-9999,291.5,310.5,298.75,300.75), NULL);  
  COMMIT;  
  </code></pre>
  
  <p>using the SQL statement</p>
  
  <pre><code>select O3.* from test_2 t, table(t.o3) O3  
  </code></pre>
  
  <p>I can get the result</p>
  
  <pre><code>COLUMN_VALUE
  281.25
  -9999
  291.5
  310.5
  298.75
  -9999
  291.5
  310.5
  298.75
  300.75
  </code></pre>
  
  <p>The question is how I get the results like</p>
  
  <pre><code>DATE_START  DATE_END    03.VALUE1 03.VALUE2 03.VALUE3 03.VALUE4 03.VALUE5
  01/01/2005  01/05/2005             281.25    -9999     291.5   310.5     298.75
  01/02/2005  01/06/2005             -9999     291.5     310.5   298.75    300.75
  </code></pre>