title: Oracle PL/SQL: Dump query result into file
body: <p>I'm working on a pl sql stored procedure. 
  What I need is to do a select, use a cursor and for every record build a string using values.
  At the end I need to write this into a file.
  I try to use dbms_output.put_line("toto") but the buffer size is to small because I have about 14 millions lines.
  I call my procedure from a unix ksh.
  I'm thinking at something like using "spool on" (on the ksh side) to dump the result of my procedure, but I don' know how to do it (if this is possible)</p>
  
  <p>Anyone has any idea?</p>