title: Spooled output in SQL*Plus with multiple parameters
body: <p>I am trying to launch a .sql with SQL*Plus using a Powershell script. For some reason the script does not generate output when i use a second parameter in the command line. It does work when I only use one. Can anyone tell me what I'm doing wrong? </p>
  
  <p>The Powershell line im using to start sqlplus is as follows: </p>
  
  <pre><code>    Run-LocalProcess SQLPLUS "${USER/PASS} @${SQLPATH}\something.sql ${1STPARAMETER} ${2NDPARAMETER}"
  </code></pre>
  
  <p>Where LocalProcess is a function we use to start processes in the CLI. The 1st parameter is the filepath of the spooled output without \ on the end. The 2nd parameter is a number we are trying to add to the spooled output filename.</p>
  
  <p>The .sql we are using is as follows:</p>
  
  <pre><code>    set heading off
      set pause off
      set verify off
      set termout off
      set trimspool on
      set feedback off
      set linesize 500 
      set pagesize 0
      set escape ^
  
  column sys_date heading "SystemDate" new_value sys_date format a20;
  
  select  to_char(sysdate,'YYYYMMDDHH24MISS') sys_date
  from    dual;
  
  column db_name heading "DatabaseName" new_value db_name format a12;
  
  select  d.name db_name
  from    v$database d;
  
  spool &amp;1\&amp;2something_&amp;db_name._&amp;sys_date..txt
  SOMETHING
  spool off
  </code></pre>
  
  <p>The reason im setting escape to ^ is that the standard escape of SQLPLUS is a backslash. </p>