title: SQLPLUS - Multiple sql statements from command line
body: <p>I have an Oracle 11 instance on Windows 2003 R2.</p>
  
  <p>I run this to get the output as shown below: </p>
  
  <pre><code>C:\&gt;echo select count(*) from v$session; | sqlplus -s zabbix/pwd@localhost:
  </code></pre>
  
  <p>1521/orcl</p>
  
  <pre><code>  COUNT(*)
    ----------
         31
  </code></pre>
  
  <p>But, I want the output to just be 31, and not with the column header and the lines below it - something to the effect of <code>SET HEADING OFF</code> from within SQL*Plus.</p>
  
  <p>I came across <a href="https://stackoverflow.com/questions/1639704/sqlplus-statement-from-command-line">this question</a> which suggested using the <code>-e</code> option for <code>echo</code>, but that either doesn't seem to work on Windows or I am missing something.</p>
  
  <pre><code>C:\&gt;echo -e "set heading off; \n select count(*) from v$session;" | sqlplus -s zabbix/pwd@localhost:1521/orcl
  
  SP2-0734: unknown command beginning "-e "set he..." - rest of line ignored.
  </code></pre>
  
  <p>This is the exact command mentioned in the post I referenced above:</p>
  
  <pre><code>C:\&gt;echo -e "select 1 from dual; \n select 2 from dual;" | sqlplus -s zabbix/pwd@localhost:1521/orcl
  
  SP2-0734: unknown command beginning "-e "select..." - rest of line ignored.
  </code></pre>
  
  <p>I do not see a SQL*Plus flag I can use (like <code>-s</code> I used above for silence) to turn heading off. Hence trying this method!</p>
  
  <p>What can I do to make it work on Windows?</p>