Usually for exporting oraclce sql output to any formats (text, pdf, excel, xml), we will go for toad or any other tools.But when we want to fetch the sql output from server, this is not an easy one.Some cases firewall issue will break the toad to get connected from server.
For exporting the oracle output to excel, we can use the following command in terminal
SET MARKUP HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF ;
SELECT * FROM SITES.ARTICLES;
SPOOL :Stores query results in a file, or optionally sends the file to a printer
Will convert will remove all the spaces and convert all characters, symbols into ascii
Path to store the sql output as excel
Sql query to fetch
Swtiching off the spool
So its too simple to convert the sql results to excel format in oracle.