Toad World® Forums

SQL WHERE clause automation

Greetings,

I started working with toad data point automation the other day and I really like the result and ease of use. Now I would like to take this to the next level.

I execute the same sql script 10 times to generate 10 identical reports that I distribute to 10 different vendors. Every time I run the script I have to update the where clause which use the IN operator.

I was able to successfully automate repot 1. Which means I have 9 more identical automation scripts to create.

How can I use one single automation script to generate all of my 10 reports.

Hi,
you could use automation variabless for this. Is the email address the only variable you need to change?
Have you also tried to use Workbook for this? It might be even better suited for things like this.

Thank you. Email addresses and the SQL WHERE clause are the variables.
For example, one report will include region 1 2 3 4. Another report include region 4 5 6 7. What do you mean by using workbook?

Regards

Workbook is our new feature. Launch it like this:
image

1 Like

My company is still using 3.6 version. I could not find Toad Workbook in our software catalog.

Huh, that's almost six years old. Can you try a trial version - I suppose you'll see lots of improvements in Automation and other parts of Toad too.
Anyway, can you see Help | Automate Tasks | Tutorials | Using Loop Dataset Activity? Is this what you wanted to perform?

Greetings

I am not sure this would work based on the tutorial. I want to run the same query 10 times but every time I need to change the WHERE clause.
What I did so far is created 2 separate automation scripts to run the first 2 of the 10 reports. Is there any way to get by with creating one automation script that will produce the 10 reports and email them out to 10 different groups.

Do you have anymore feedback or suggestions?

I'd really recommend these tutorials https://blog.toadworld.com/2013/03/14/toad-data-point-automation-series-1-introduction-to-automation there is even one about loop dataset - https://www.youtube.com/watch?v=MYEFZYz05mQ