How do I insert data from Oracle Database into an MS Excel spreadsheet?
If you have Microsoft Query installed, you can choose Data->Get External

    Requires Free Membership to View

Data->New Database Query to define a query run against an ODBC definition for your Oracle database. Typically, that takes too much time for me to set up. I typically just generate a flat file with the output from my Oracle database. In SQL*Plus, I issue something similar to the following:
set linesize 130
spool c:temporacle_query.txt
select * from my_table;
spool off

A file will be created that contains the output from SQL*Plus. I then choose File->Open in Excel and select the file that I created. Excel will recognize that this is a flat file and will start a wizard to map the data to columns in the spreadsheet. Follow along with the wizard and your data will be placed into the spreadsheet.

This was first published in May 2004

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.