Ask the Expert

Inserting data into Excel

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: