Using variables to control loops inside packages
Process control looping is a commonly used technique in many forms of software development and the need for such methods is no different in ODI. There are many use cases where managing the exact number of process cycles is a functional requirement. By using separate steps to initialize, increment, and evaluate the value of a designated loop-control variable, an ODI developer is able to tightly manage the process cycles needed to satisfy those requirements. In this recipe, we will develop a package that executes an interface a specific number of times before terminating.
Getting ready...
In order to give our package something to do, we will reuse the Int_Variable
interface created earlier in the previous Using variables in topology exercise.
How to do it...
Create a variable called
PV_LOOP_CNTRL
.Select the Data Type as
Numeric
.Select the Keep History option as No History.
Create a package called
Pkg_Variable_Loop
.On the diagram panel of the package...