I have an Oracle 11 instance on Windows 2003 R2.
I run this to get the output as shown below:
C:\>echo select count(*) from v$session; | sqlplus -s zabbix/pwd@localhost:
1521/orcl
COUNT(*)
----------
31
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 SET HEADING OFF
from within SQL*Plus.
I came across this question which suggested using the -e
option for echo
, but that either doesn't seem to work on Windows or I am missing something.
C:\>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.
This is the exact command mentioned in the post I referenced above:
C:\>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.
I do not see a SQL*Plus flag I can use (like -s
I used above for silence) to turn heading off. Hence trying this method!
What can I do to make it work on Windows?