title: oracle ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated Bind
body: <p>When using a cursor to bulk collect results in a sys.odcivarchar2list i get this error:
  ORA-06502: PL/SQL: numeric or value error: Bulk Bind: Truncated Bind
  My loop executes for many times with no error but only for a specific table which i collect all data into the varchar2 list i am getting this error. I used this code:</p>
  
  <pre><code>declare
    filehandle1 utl_file.file_type;
    myquery varchar2(4000) := 'select column1 ||''~''|| column2 from mytable';
    mycursor sys_refcursor;
    myresults sys.odcivarchar2list;
  begin
    filehandle1 := utl_file.fopen ('D42', 'mydata', 'w');
    open mycursor for myquery; 
    loop
     fetch mycursor bulk collect into myresults;
  if myresults.count&gt;0 Then
      for idx in myresults.first..myresults.last loop
        utl_file.put_line(filehandle1, myresults(idx));
      end loop;
  End if;
      exit when mycursor%notfound;
    end loop;
    close mycursor;
    utl_file.fclose(filehandle1);
  end;
  </code></pre>
  
  <p>This returns results from more than 100 tables but only 1 of the tables is crashing. 
  Thank you in advance for your help</p>