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 in the excel sheet.But i can see only output. Not actual query "select name from v\$database;". we need actual sql statement also in another tab.
It should be also added in another tab of excel sheet.Not the same tab of the output.
Any Suggestions.
Thanks & Regards