I dont think that You can save the output in the excel format. However you can save the output in text format as per me.
I think we can do it by using spool
can you please elaborate how can we save the output in excel format using spool. I will also come to know if you give publish the example
Excel is a Microsoft proprietary format. Why bother? MS Excel can read and automatically interpret several formats, such as comma, space or tab separated values. CSV or comma-separated it probably being the most common.
Creating output that can be used in Excel under SQLPlus is very easy. For example:
SQL>set markup html on
SQL>set feedback off
SQL>select * from ....
SQL>set markup html off
This is not a question for Linux.
1 person found this helpful
I think this reply the part of the sqlplus, however the original poster was asking for a shell script, who indeed apply to linux.
You need to have a package that include the software uuencode to be able to automate send a file over email
if you are in Oracle Linux 6 (or rh6) the package is sharutils
then, you can do a script like this
sql='select stament here;'
ORA_USER='/ as sysdba'
sqlplus -s $ORA_USER << EOF
uuencode file.xls | mail -s subject $user