Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Spool to Excel File
Hi,
Years ago, I stole this idea from:
http://www.quest-pipelines.com/newsletter-v3/newsletter_1002.htm
I've used it a few times, mostly to impress bystanders. It's got size limitations, but kinda cool anyhow.
<QUOTE>
Getting SQL Query Results into an Excel Spread Sheet
By Pavel Luzanov
This months script will help users get SQL query results into an Excel spread sheet.
SET LINESIZE 999 VERIFY OFF FEEDBACK OFF SET MARKUP HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF DEFINE table_name = &1
SPOOL &table_name..xls
SELECT * FROM &table_name;
SPOOL OFF
SET MARKUP HTML OFF ENTMAP OFF SPOOL OFF PREFORMAT ON
SET LINESIZE 80 VERIFY ON FEEDBACK ON
REM Use this command to start Excel from char-mode
sqlplus
REM HOST start &table_name..xls
REM Use this command to start Excel from GUI-mode
sqlplus
HOST start excel.exe &table_name..xls
<\QUOTE>
Regards,
Mike Thomas
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Michael Thomas INET: mhthomas_at_yahoo.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Mon Jan 19 2004 - 23:34:25 CST