Submitting forms on the support site are temporary unavailable for schedule maintenance. If you need immediate assistance please contact technical support. We apologize for the inconvenience.
Variable declared outside of WHILE loop is being reset to initial value and causing loop to continue
Description
A variable called ROWS is setup at the beginning of an automation script, with an initial value of 1. In a WHILE loop (tests for ROWS > 0) there's an UPDATE and a SELECT activity. After the update, the select should return 0 rows, which should set ROWS to 0 (zero), which it appears to do, according to the log. However, on the loop around, it seems that ROWS is then set back to 1. This means that the WHILE activity keeps looping until the loop limit is reached. Why does this happen?
Cause
This is a scope issue. The ROWS declared outside the WHILE loop is not the same as the ROWS within the loop. Setting the 'RowCount variable name' to ROWS effectively declares a new variable within the WHILE loop.
Resolution
Add a 'Set Variable Value' activity to the loop. This should set the Variable name ROWS to have the value of the 'RowCount variable name' #Execute_1_RCOUNT# as shown in the image below:
Your Request will be reviewed by our technical reviewer team and, if approved, will be added as a Topic in our Knowledgebase.
Recommended Content
Product(s):
Toad Data Point
Topic(s):
Troubleshooting
Article History:
Created on: 5/10/2016 Last Update on: 5/7/2023
Thank you for your feedback for Topic Request
Your Request will be reviewed by our technical reviewer team and, if approved, will be added as a Topic in our Knowledgebase.
Welcome to Quest Support
You can find online support help for Quest *product* on an affiliate support site. Click continue to be directed to the correct support content and assistance for *product*.
Search All Articles
IE 8, 9, & 10 No longer supported
The Quest Software Portal no longer supports IE8, 9, & 10 and it is recommended to upgrade your browser to the latest version of Internet Explorer or Chrome.