title: Oracle/SQL PLUS: How to spool a log and write intermittently throughout script
body: <p>Figuring out how to spool to a file has been easy enough.  I am hoping there is an option to write to the text file after each command is written.  I am not sure how to communicate the status of a long script to other people on my team.  The solution we were going for was to write a log file to a network drive, as the script executes they would be able to follow along.</p>
  
  <p>However, this seems to only write output to the file after the spool off; command at the end of the file.  </p>
  
  <p>Is there any way to achieve what we're trying to do, either with spooling a log file or another method?</p>
  
  <p>Here is the code I have so far. </p>
  
  <pre><code>set timing on;
  set echo on;
  
  column date_column new_value today_var
  select to_char(current_timestamp, 'yyyymmdd_HH24_MI') as date_column
    from dual
  /
  select current_timestamp from dual;
  
  SPOOL 'Z:\log\KPI\secondary_reporting_&amp;today_var..log'
  
  ... lots of stuff...
  spool off;
  </code></pre>