Toad World® Forums

Export Dataset with Parameter from List Iterator

Hello,

I tried to export dataset like

select :NAMEN as UEBER from dual

I used “set variables” and bind :NAMEN with the List Iterator NAMEN (two entries : NAME1,NAME2).

I am export this as an excel file and the output is:

UEBER
%NAMEN%
I would expect NAME1 (for the first iteration) … where is my fault ?

greets

Ralf

  1. in the list interator, use single quotes around each value

  2. make your select like this: Select &NAMEN as EUBER from dual

  3. in the “Set Variables” dialog, choose “Environment Variables” and then then name of your list iterator.

Select * from &MySchema…&My_tables_list_iterator;

Toad For Oracle 12.10.0.30

I have the same issue and no resolution after 2 hours of searches and trial and error.

The Set Variables dialog in the Export Dataset action does not show List Iterator variables in the Environment Variables list.

The &MySchema in my query is a global toad variable, so that works fine. But the table names that I want to loop over should come from the parent List Iterator, but that iterator variable is not recognized at all.

This works in Toad 12.12. Unfortunately, it does not work in 12.10. "List Iterator 1" doesn't show up among the environment variables in the 2nd screenshot in 12.10.

Then run it by right-clicking on the List Iterator action and choosing "Run". Toad creates c:\EMP.txt and c:\DEPT.txt.

What can I do to workaround this in 12.10 ?

Is there no way to iterate over Export Dataset action at all ?

Is there any way to set an environment variable to the result of a query or another variable ? Or even just i = i + 1 ?

There’s no way to use a list iterator with export dataset in 12.10. You can export multiple tables/views like this:

  1. go an Export Dataset action on automation designer. Double-click it to open the Export Dataset window.

  2. click on “dataset” tab and choose “Export objects”

  3. click “Add” to add the objects that you want to export.