Toad World® Forums

How to input a variable at runtime for use in multiple SQL queries

Does anyone have a complete and clear explanation (example) of how to set up your automation script so that it sets the value of a variable by asking for user input? The same variable value will be used in 12 separate sql queries that called in the automation script I have only been using TOAD for a week, but cannot find anything that helps me.

Jackie

Here is a Blog post about variables and automation. It is based off of an older version of TDA so the screenshots look a little different.

http://www.toadworld.com/Blogs/tabid/67/EntryId/498/Automation-Variables-Automation-variables-using-datasets.aspx

In automation you will not be able to prompt the user for input. But you can generate your on variable values by executing a query. A very common use case for automation is to execute a driving query. Then for each row of that result set execute a report query and use that row data to filter the report.

Read the blog and if you would like a sample script to help you out let me know.

Debbie

I tried to read that article, but got lost. I guess I’m too used to programming in VBA. I might have to stick to the find and replace - it works, but I have to change the find value and the replace value for 10 of the 12 queries in my script. Still beats the crap out of doing it all manually one at the time.
Jackie