Parameter Example: Using Iterate

This example takes a series of tables in a large database and extracts them into individual files.

You can do this by creating a two- task VI script.

VI Iterate Showing Two Tasks

In the first task, iterate, you list the table names with a ClosedList input object.

VI Iterate Showing List Input

TIP: The column heading here gets set as a parameter in the Iterate object.

After the list object, add an ClosedIterate output object and create a parameter for the table names.

VI Iterate Setting Parameter

The second task, extract table, extracts the individual tables with an ClosedSQL input object, by using the parameter set in the Iterate object (table_name) as the Sql_Table name.

VI Iterate Example Using Parameter for Table Name

The ClosedFileout output object is used to define individual files by setting the output file name with the parameter.

VI Iterate Example with Parameter in output file name

When you run the script, it iterates through for each row in the List input object of the first task and writes out a Closedfile for each row.

VI Iterate Example Output