Hi All,
We have oracle 11.2.0.4 on Aix 7.
I am asked to prepare a shell script to send a output to excel file.
Script
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
export ORACLE_HOME=/u01/ora
export ORACLE_SID=TEST
export PATH=$ORACLE_HOME/bin:$PATH
sqlplus -s "username/password@test" << EOF
spool Jan_01.xls;
set echo on;
set timing on;
set time on ;
select name from v\$database;
EOF
spool off;
exit;
uuencode Jan_01.xls Jan_01.xls; | mail -s " Nov_06" xyz@m.com
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The above sql statement is not actual one.
The output is fine. the output comes without actual sql statement ( select name from v\$database; ).
But we need the actual query also in the same tab ( excel sheet ) with output. Is it possible.
And
How to add a sql statement in the existing Jan_01.xls?
Any suggestions
Thanks & Regards,