how to extract the data from database (oracle) and send the output as an .xls file?

Hi,
How to extract the data from Oracle database and sent the output data to mails using mailx command with .xls attachement?

Here i know how to connect the database using unix shell script and
how to use the mailx command in UNIX script
But i don't know how to use the .xls format file (i tried to make the .csv file)

please some one hele me out on this.

Have you searched the forum ?
look for uuencode
read this for instance

As you said you basically just need to connect with your script, gives the right parameters (like SET echo OFF...)
spool in a file
then uuencode yourfile.xls yourfile.xls and pipe or mail -s the result