# Export dataset multiple queries

**URL:** <https://forums.toadworld.com/t/export-dataset-multiple-queries/43443>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [November 6, 2018, 5:47pm UTC](https://forums.toadworld.com/t/export-dataset-multiple-queries/43443 "2018-11-06T17:47:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcel.m.garcez](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@marcel.m.garcez](https://forums.toadworld.com/u/marcel.m.garcez)\
**Post date:** [November 6, 2018, 5:47pm UTC](https://forums.toadworld.com/t/export-dataset-multiple-queries/43443/1 "2018-11-06T17:47:49Z")

</div>

Hello guys  
This is my first post here and I have a question about queries export.

I have multiple .sql files (+600) and each return between 100k - 300k lines.  
I need to export the results from each .sql to .xlsx files.

What I’m doing now, F9, right click “export dataset”, type the name of the file (that should be the same as the .sql file) and export to Excel file but it’s exhaustive.  
I tried list iterator + export dataset but in the tab Dataset I put %List Iterator1% as I saw in this same forum and I have “invalid SQL statement”.

Is there any way to automatize this work or simplify it? My knowledge in Toad is almost zero, please, any help would be great. Thank you

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [November 6, 2018, 11:08pm UTC](https://forums.toadworld.com/t/export-dataset-multiple-queries/43443/2 "2018-11-06T23:08:51Z")

</div>

The Folder Iterator is what you want here, but I see that the export dataset's "SQL FIle" feature doesn't support variables. I am adding this for next beta. Assuming all your SQL files are in the same folder, you will be able to do this:

.SQL Files are in a folder called c:\Queries.

Set up your action like this:  
 ![image](https://global.discourse-cdn.com/quest/original/2X/8/881d992440fd72b68b64fb0e2d329264e1365260.jpeg)

Folder iterator detail:  
 ![image](https://global.discourse-cdn.com/quest/original/2X/6/63759a9ad07582121029a105cd962648bec05a51.jpeg)

Export Dataset detail:

 ![image](https://global.discourse-cdn.com/quest/original/2X/5/5f8eab4c07b6afab687037193f74ef3a81554340.jpeg)

 ![image](https://global.discourse-cdn.com/quest/original/2X/e/ea01efdad76f926949c06b1c15d32d3e886d1f89.jpeg)

then, right-click on the "Folder" action and choose "Run".

---

<div class="post-metadata">

**Author:** ![marcel.m.garcez](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@marcel.m.garcez](https://forums.toadworld.com/u/marcel.m.garcez)\
**Post date:** [November 7, 2018, 11:04am UTC](https://forums.toadworld.com/t/export-dataset-multiple-queries/43443/4 "2018-11-07T11:04:18Z")

</div>

Thanks a lot man. I believe it will work. Just one more question  
I’m using Toad for Oracle 13.0.0.80 and I don’t see “SQL file” radio in the Dataset tab.  
Any tip?

![tab](https://global.discourse-cdn.com/quest/original/2X/a/a2bc13bb5b9f899183281c8337dd5fc920e7d780.png)

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [November 7, 2018, 1:50pm UTC](https://forums.toadworld.com/t/export-dataset-multiple-queries/43443/5 "2018-11-07T13:50:09Z")

</div>

The “SQL File” button first appears in Toad version 13.1. And I just made a change for tomorrow’s beta so that variables would work there.

So…update to version 13.1, and you can get the beta here: [Toad for Oracle 13.2 Beta](https://forums.toadworld.com/t/toad-for-oracle-13-2-beta/41283)

The beta will not work unless 13.1 is installed. You can keep 13.0 installed also if you want.

---

<div class="post-metadata">

**Author:** ![marcel.m.garcez](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@marcel.m.garcez](https://forums.toadworld.com/u/marcel.m.garcez)\
**Post date:** [November 8, 2018, 1:45pm UTC](https://forums.toadworld.com/t/export-dataset-multiple-queries/43443/6 "2018-11-08T13:45:47Z")

</div>

Thanks again. I've updated to 13.1 and new I have to SQL file option however, I have another problem. I tried a lot of ways to make it work but I had no success. Could you help me again?  
Thank you very much for your help.

 ![1](https://global.discourse-cdn.com/quest/original/2X/c/ce36036e92457981fb97ca0ee942258c086f2de9.png)

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [November 8, 2018, 2:23pm UTC](https://forums.toadworld.com/t/export-dataset-multiple-queries/43443/7 "2018-11-08T14:23:47Z")

</div>

Sorry, I should have been more clear above.

13.1 has the SQL File field but in 13.1, it doesn’t support variables like %folder%.  
I added variable support to the next 13.2 beta, which should come out later today. So if you get the [Toad for Oracle 13.2 Beta](https://forums.toadworld.com/t/toad-for-oracle-13-2-beta/41283), after today’s update, then what I described above should work.

We’ll post an update here [https://forums.toadworld.com/c/toad-for-oracle-beta](https://forums.toadworld.com/c/toad-for-oracle-beta) when today’s beta update is released.

---

<div class="post-metadata">

**Author:** ![marcel.m.garcez](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@marcel.m.garcez](https://forums.toadworld.com/u/marcel.m.garcez)\
**Post date:** [November 8, 2018, 3:52pm UTC](https://forums.toadworld.com/t/export-dataset-multiple-queries/43443/8 "2018-11-08T15:52:04Z")

</div>

Ohhh yes, sure. I’d read your comment too fast and hadn’t understood, now I got it HAHA  
Thanks again 😁

---

<div class="post-metadata">

**Author:** ![marcel.m.garcez](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@marcel.m.garcez](https://forums.toadworld.com/u/marcel.m.garcez)\
**Post date:** [November 8, 2018, 6:56pm UTC](https://forums.toadworld.com/t/export-dataset-multiple-queries/43443/9 "2018-11-08T18:56:26Z")

</div>

I’ve just tested 13.2.0.9 and it worked like a charm.  
That’s awesome, thanks a lot. You saved me aprox. 2 months work

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [November 8, 2018, 7:05pm UTC](https://forums.toadworld.com/t/export-dataset-multiple-queries/43443/10 "2018-11-08T19:05:56Z")

</div>

Great! You’re welcome.
