using iterators for sql expression

724
1
03-09-2012 08:11 AM
sarbajitgurung
New Contributor
In modelbuilder, I have "make query table" tool which relies on sql expression to query table and output a table. There are many possibilities of the sql expression so I have made it a model parameter. Now I'd like to create an iterator so that each time the expression changes, a new table is created in my workspace. Does anyone know how to do this. I've attached the model herewith. [ATTACH=CONFIG]12558[/ATTACH]

Any help would be greatly appreciated.

Many thanks,
Sarbajit.
0 Kudos
1 Reply
sarbajitgurung
New Contributor
Modelbuilder allows to make a list of expression, so I've managed to get many expressions (as parameters) and execute the query accordingly. This works fine. Now I'd like to join each table with a layer (grids1.lyr) that will eventually give me different layers as output, for example, QueryTable A/B/C (join field: X) -  Layer Name: grids1.lyr (join field: X) --> output layers: gridsA, gridsB, gridsC. I believe I have to use "For Iterators" to achieve this but I couldn't get it to work. Can anyone assist me please? Here's the model I created (without the for iterator):

[ATTACH=CONFIG]12611[/ATTACH]

Thanks,
Sarbajit.
0 Kudos