Hi,
I am using the sybase database server though unix platform and try to retrieve some data by the help of select statement, and my main issue is i want to redirect all the the data i.e. retrieve from the select statement to a .xls file with the same column name and the outputs. How can i do this and what is the script ?
The Excel xls format is a binary file format. You'll have a very, very, very hard time writing it using only shell scripting. Better to use a scripting language like Perl for it, as you can use DBI, DBD::Sybase, and Spreadsheet::WriteExcel for a self-contained, platform-independent converter.
A different way would be to create a CSV as suggested, or to use ODBC to access the DB directly.