title: Oracle PL/SQL query nested table collection and value key name
body: <p>I am looking to cast a nested table so i can use a query to reorder the values. As there isn't a key name I am wondering what the column name would be?</p>
  
  <p>I know this isn't the correct syntax but it's an illustration of what I'm looking to achieve.</p>
  
  <pre><code>CREATE OR REPLACE TYPE a_nested_table AS TABLE OF VARCHAR2(20);
  
  CREATE OR REPLACE FUNCTION my_func RETURN VARCHAR2 IS
      output VARCHAR2;
      list a_nested_table := a_nested_table('foo', 'bar');
  BEGIN
      FOR current_record IN( 
          SELECT column_name INTO bar
          FROM TABLE(CAST(list AS a_nested_table))
          ORDER BY UPPER(column_name) ASC
      ) LOOP
          output := output || current_record.column_name
      END LOOP;
  
      return output;
  END my_func;
  </code></pre>