I have been really hard on Excel lately. Excel is an excellent tool. Tools can be misused and abused, but it’s not their fault. I should know this being an advocate for Toad, but I digress.
Updated on 1/5/2011 to include 4th Method and add note on ‘Display all results in grid’ option.
You want to get data from Oracle to an MSFT Excel spreadsheet. You have Toad. I know of at least 3 ways you can do this. Each have their own advantages. Let’s take a few moments to explore your options.
Copy & Paste
By far my least favorite option, this is probably also the most popular method used by new users to Toad. You select your data in the grid, Ctrl+A, Ctrl+C, ALT+TAB, Ctrl+V – voila! Your data is now in Excel. What’s wrong with this method?
Nothing.
Everything!
You need to make sure Excel is open first. You won’t get any formatting, i.e. dates won’t come over as ‘date’. If you want to format the data in Excel after-the-fact, there’s no way to automate that without creating a macro.
But if it works for you, then happy days!
Export Dataset – Delimited Text
According to the developer, this is your fastest option. The only caveat is certain datatypes may not play nice. And of course it won’t be an XLS or XLSX file. I just tested this and it took about 25 seconds on my machine, not counting the time Excel took to load the file. At this point I would have to agree with the developer!
You’ll want to make sure you set the ‘Delimited Text’ export option to have the delimiter set to ‘Comma’ and the change the file extension from .TXT to .CSV (Comma-Separated Values). Also en-sure that auto-open is enabled and that you have Excel set as the default program for files of extension CSV.
Export Dataset – Excel File
This method is probably what you are used to using. You invoke it from any data grid. Toad will retrieve all the records from the database, and write them to a physical XLS file on your machine or network.

Toad gets a lot of grief for the number of options it has, but I’m never lacking for suggestions from users on how to make the tool more powerful or useful. The options for creating the Excel file here are just on this side of overwhelming, but there are a few I want to call out:
Most of these options are self-explanatory, but you do need to actually investigate your choices if you want to take advantage of them! The second choice does need a bit more explanation, so let’s cover that now.
“Display all results in grid” – Checking this will cause Toad to not only fetch the rest of your table or query rows from Oracle to put them in your file, it will also populate the data grid you are exporting from with said rows. That sounds fairly benign, and why WOULDN’T you want to do this? Well, if you do, you’re going to add a step to the process, and you’re going to need more memory. If your exports are taking too long to execute, then uncheck this option! This is one of those tricks I’ve picked up over the years and take for granted. Here’s an opportunity to impress your friends and co-workers.
However, if you do disable this, Toad will re-execute the query. So if the data has changed between runs, or if the initial query took a long time to run, you may want to leave this option enabled.
Some things to be aware of:
Export Dataset – Excel Instance
This is the method I use more often than not. Why is that? I can:
The ‘Instance’ option talks to MSFT. It asks, “Are you there Excel, it’s me, Toad.” If Excel answers ‘Yes’, it dumps the data over into a new sheet, or into the active one based on the ‘Start at active cell’ option. If it answers ‘No’, then it first opens Excel, then dumps the data. So, this option DEFINITELY requires you to have Excel installed and licensed.
Not to get too defensive, but I ONLY build the 1,000,000 XLS files as an exercise. I probably get asked how to accomplish this task about 2 – 3 times a week.
Example
I use SH.SALES as an example. It takes approximately 90 seconds for my 11gR2 database and Win64 Win7 machine with 8GB of RAM to create the instance of Excel with 918,884 rows or 15.9MB of data.
The primary reason I use the Instance option if for appending lots of data to single file. I can simply click into the cell I want the data to go, then click the ‘Export’ button in Toad and have that data sent over auto-magically formatted.
Summary
So here we have another perfect example of Toad having multiple ways to accomplish your task at hand. Each have their own merits. Use them at your own discretion. I didn’t talk about Toad being able automate this process, but you can code Toad to create and email your XLS files on demand or on a schedule.



Twitter
RSS
GooglePlus
Facebook
Tweets that mention Three Ways to get Data into Excel with Toad | 140,000 Characters or Less -- Topsy.com
Dec 31, 2010 @ 16:23:26
[...] This post was mentioned on Twitter by Jeff Smith, Jeff Smith. Jeff Smith said: [Toad Blog}: Get Data from Oracle Into Excel, 3 options explored. http://bit.ly/eXHZnT [...]
Feb 01, 2012 @ 02:52:14
How can change/set type of files Excel from Excel2003( *.xls) to excel2010 ( *.xlsx) to export data from Toad (database Oracle) ?
My version of Toad is 10.1
and allways I export in Excel format, result only 65000 row per sheet and I want to export more then that, Excel 2010 (xlsx) know more the 65000row/sheet .
Please sensd respons by mail: mihai.merloi@gmail.com
Thank you very much!
Feb 02, 2012 @ 08:19:52
I export with Instance Excel and is faster, 960 000 rows in only one page of Excel.
As I say on E-mail, restriction to 960 000rows is for my version Toad10.1 and Office2010 , but for me is OK.
I understand that version Toad 10.5 can export more then 1milion rows.
This documentation is very useful!
Thank you.
Nov 07, 2012 @ 14:05:08
Your post regarding the Excel Instance Toad export option for 1,000,000 row worksheets really came in handy for me today. I was able to accomplish exactly what I was looking to do just by following the steps that you had laid out.
Thank you!
P.S. cute baby!
Jan 18, 2013 @ 10:51:54
I’ve got a big query result set I’m trying to export (currently to .CSV) for import to Excel. This takes a very long time, so I looked up how to get around this lag, which led me here. I tried unchecking the “display all results in grid” option, but this is still taking a very long time and essentially hangs my system unless I out of the export. Any thoughts on other alternatives for the text-based output? (Perhaps I need to provide more details?) Thanks!
Jan 18, 2013 @ 10:53:31
Yeah, try this
http://www.thatjeffsmith.com/archive/2012/05/formatting-query-results-to-csv-in-oracle-sql-developer/
Apr 03, 2013 @ 05:15:11
As i do not have excel installed on my database server i had just one choice to export the data into “Excel File”. I had some 20 queries which i wanted to dump the data into one excel workbook into multiple excel sheet. THis was not possible using the “Excel File” option though i had different Sheet Name mentioned it was overwriting and was not creating different sheet. So i ended up using CSV and then i had to write a macro to import all the CSV into different worksheet.
I might be wrong..if i am then please let me know….I currently using TOAD 9.7.0.51
Apr 03, 2013 @ 10:44:20
I don’t work with that product anymore. For support I would go to Dell.
I can however help you if you’re interested in trying this with Oracle SQL Developer.