User guide
Data Integration with Sybase Avaki Studio 151
Iterator
tain your own iteration control variables (such as a counter that you increment).
When you configure a range input, Studio automatically checks for the end of the
result set and terminates the loop under that condition. You can add an expression
in the Condition field (see below) to cause the looping to terminate while there are
still rows left in the range input, but you cannot cause the iteration to continue after
all rows in the range result set have been used.
• Initialize: Enter expressions that set up any variables you need, either to control the
iteration or to be made available to upstream operators. You can enter any Java-
Script code here that would be valid inside a function body. See “Using expressions
within Avaki Studio” on page 66 for details on using JavaScript code within Studio.
• Increment: Enter expressions that update the variables you initialized in the previ-
ous field. If you’re using a variable to control the iteration, increment its value here.
If you’re using any other variables that upstream operators need to access, update
their values here as well. If you’re using a range input, you can update the variables
based on the values of the columns in the current row of the range input. Here, too,
you can enter any JavaScript code that would be valid inside a function body. See
“Using expressions within Avaki Studio” on page 66 for details on using JavaScript
code within Studio.
• Condition: Enter a Boolean expression. (Optional.) While the Boolean expression
evaluates to true, the operator continues to iterate, re-executing its primary input.
When the Boolean expression evaluates to false, the iteration ceases. If you’re
using a range input, Studio first checks for the end of the range result set. If its rows
aren’t yet exhausted, Studio evaluates your condition as well, and if your expres-
sion evaluates to false, iteration stops. See “Boolean expressions” on page 66 for
details on constructing Boolean expressions.
• Execute inputs in parallel: Normally, the Iterator operator waits to advance to
the next iteration until the result set from the previous iteration has no more rows of
data left. If you select this checkbox, the Iterator will iterate until the condition
expression evaluates to false, queuing up the result sets and then passing them
downstream as they are requested. If the elements upstream of the Iterator involve
operations external to the current data service (such as Input Source elements),
they will essentially all be executed simultaneously, generally resulting in
improved performance.