Kindly explain what is expected if Step 3 does not contain data. Assuming run should be stopped
Logic looks fine. But based on your steps - there is no end point if data is available even after couple of loops
- Create an integer variable i and assign the value as 0.
- Create a boolean variable - boolContinueRun and set value as True
- You can use a do while loop like below
- DO
Increment i variable
Run Query
Get Interim Output
Based on interim output - compare and get actual output
If Output does not contain data OR i>4 (or the max loop expected)
Set boolContinueRun =false
While (boolContinueRun=True)