title: "local collection types not allowed" error in PL/SQL ORA-06550
body: <p>i am trying trying to get a query from oracle table called "sys.all_objects" 
  into a string variable, so then i can give it to "dbms_obfuscation_toolkit.DESEncrypt" as input, after than encrypted string will go in to "utl_file" so i can write it into a txt file.</p>
  
  <p>Here's the problem, when i try to query with this code;</p>
  
  <pre><code>DECLARE
  TYPE name_array is array(50) OF varchar2(100);
  var_input  name_array; 
  
  BEGIN
  SELECT owner
    INTO var_input
    FROM sys.all_objects;
  
    FOR i IN var_input.FIRST .. var_input.LAST
      LOOP
          dbms_output.put_line(var_input(i));
      END LOOP;
  END;
  </code></pre>
  
  <p>and the error is;</p>
  
  <pre><code>ORA-06550: line 7, column 12:
  PLS-00642: local collection types not allowed in SQL statements
  </code></pre>
  
  <p>any idea  about geting through this issue ?</p>
  
  <p>for the ones who want to see the full code ;</p>
  
  <pre><code>CREATE OR REPLACE DIRECTORY data AS 'd:\folder';
  GRANT read, write ON DIRECTORY data TO PUBLIC;
  
  DECLARE
  var_input  varchar2(64) := 'Rndminpt';
  var_key    varchar2(16) := 'Anahtar1'; 
  var_enc    varchar2(1024);
  var_dec    varchar2(1024);
  var_file   utl_file.file_type;
  
  BEGIN
  
  -- (query part)
  
      dbms_obfuscation_toolkit.DESEncrypt(
          input_string     =&gt;  var_input,
          key_string       =&gt;  var_key,
          encrypted_string =&gt;  var_enc);
      dbms_output.put_line('Encrypted...');
  
  var_file := utl_file.fopen('DATA','textfile.txt','W');            
      utl_file.put_line(var_file,var_enc);
      utl_file.fclose(var_file);        
  dbms_output.put_line('Writen in to text... ');      
  END;
  </code></pre>