Toad World® Forums

How to check Row counter variable in condition (Automation script)


#1

Can you please advise
How to check Row counter variable in condition (Automation script)? It looks like a simple task but from some reason it is not working for me :frowning:

Automation Logging 03/06/2009 15:59:01 Query returned 9 rows
Automation Logging 03/06/2009 15:59:11 Condition: “Int(Counter)>0” evaluated to False. Child activties will not be executed
Automation Logging 03/06/2009 15:59:11 Condition: “Int(Counter)=0” evaluated to True

I use 2.5.0.559


#2

To use a row counter as a variable you will need to define the variable first. You’ll need to use the Select to File or Execute Script activity as it is only offered in these two activities. In the “Row Count varible” property enter a name.

Then use this name in the If…Condition. The name is case sensitive.

In the logging you will see the value of the counter and also the result of the condition.

Debbie
RC.jpeg


#3

very strange
lowercase defined variable : rc worked for me

variable with mixed case Counter or QueryCounter were not working, this is why I tried to cast it Int(QueryCounter)=0 because QueryCounter=0 was giving - Type mismatch error

thank you very much for quick answer


#4

I agree. Strange. It doesn’t work with mixed case var names.
It should. I must have a bug somewhere. I entered CR 63,335 to fix.
For now stick with all one case.
Thanks for brining this to my attention.