title: Take Contents of Oracle PL/SQL Table and insert into a Global Temporary table
body: <p>Using the code example from this PDF: <a href="https://thtech.files.wordpress.com/2012/12/apex_data_loading_options.pdf" rel="nofollow noreferrer">https://thtech.files.wordpress.com/2012/12/apex_data_loading_options.pdf</a></p>
  
  <p>I would like to replace all references to the Oracle APEX API APEX_COLLECTION (since I am not using Oracle APEX at all but just PL/SQL), but instead use a global temporary table to store the contents of the PL/SQL table, that is 
  being used in this example (within PDF link above).</p>
  
  <p>The main area I am having trouble with, is the <code>l_record</code> declaration of <code>varchar2_t</code> and how to take the following code:</p>
  
  <pre><code>  FOR i IN 1..l_record.count LOOP
      apex_collection.update_member_attribute(
          p_collection_name=&gt; p_collection_name,
          p_seq =&gt; l_seq_id,
          p_attr_number =&gt; i,
          p_attr_value =&gt; l_record(i));
    END LOOP;
  </code></pre>
  
  <p>and replace the storing of l_record into a global temporary table <code>MY_GTT</code> below instead of an APEX_COLLECTION, that I can reference each column returned from l_record.</p>
  
  <p>The part that I am not sure about is how can I take the contents of the PL/SQL type of <code>l_record</code> which is a <code>table of varchar2(32767) index by binary_integer</code> and store the contents as individual records, within MY_GTT?</p>
  
  <p>I have declared a GTT as follows:</p>
  
  <pre><code>CREATE GLOBAL TEMPORARY TABLE MY_GTT
  (
      SEQ_ID  NUMBER,
      C001    VARCHAR2(4000 BYTE),
      C002    VARCHAR2(4000 BYTE),
      C003    VARCHAR2(4000 BYTE),
      C004    VARCHAR2(4000 BYTE),
      C005    VARCHAR2(4000 BYTE),
      C006    VARCHAR2(4000 BYTE),
      C007    VARCHAR2(4000 BYTE),
      C008    VARCHAR2(4000 BYTE),
      C009    VARCHAR2(4000 BYTE),
      C010    VARCHAR2(4000 BYTE),
      C011    VARCHAR2(4000 BYTE),    
      C012    VARCHAR2(4000 BYTE),
      C013    VARCHAR2(4000 BYTE),
      C014    VARCHAR2(4000 BYTE),
      C015    VARCHAR2(4000 BYTE),
      C016    VARCHAR2(4000 BYTE),
      C017    VARCHAR2(4000 BYTE),
      C018    VARCHAR2(4000 BYTE),
      C019    VARCHAR2(4000 BYTE),
      C020    VARCHAR2(4000 BYTE)
  )
  ON COMMIT PRESERVE ROWS;
  </code></pre>
  
  <p>I'm getting the impression that what I am asking for here is not actually possible.</p>