Q

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 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

Dig deeper on Oracle database design and architecture

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

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:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close