title: Spooling to a file with a name containing a space and script's parameter in sqlplus?
body: <p>I'm trying to change a script with a parameter to spool the output into specific path. After searching Stack Overflow I came up with:</p>
  
  <pre><code>column filename new_val filename
  select '"i:\Direct bank\incoming\ROSE\report_zgod_' || '^1' ||'.csv"' filename from dual;
  
  spool &amp;filename
  </code></pre>
  
  <p>This creates correct filename "i:\Direct bank\incoming\ROSE\report_zgod_2017-08-28.csv" (I have tried to put it literally instead of &amp;filename and the file has been created), but it still does not write a file. My guess is that's because there is a space in the path. </p>
  
  <p>I have also tried</p>
  
  <pre><code>spool "&amp;filename"
  spool '&amp;filename'
  </code></pre>
  
  <p>but to no avail.</p>
  
  <p>I can't avoid parameter (it's used in other places in script and it can't be really calculated from SYSDATE) and I can't change the path (it has to be somewhere under "I:\Direct bank").</p>
  
  <p>How can I have both the parameter and the space in spool file's name?</p>