Driven Query


Driven Query is useful when you have a query that creates a result set, and you want to bind the return values from the result set to another query.  The next graphic shows and example of the Driven Query window.

In the above example, SQLThing will retrieve the phone_number and ID fields from a table called cus_updates. For each record retrieved, it will place the value of phone_number into the first parameter marker in the second query and then value of ID into the second parameter marker and then execute the second query. SQLThing always binds the parameters in retrieval order, i.e. parameter 1 will be bound to source field 1, parameter 2 bound to source field 2, etc.  Always ensure that you get your parameter markers/fields in the proper order.