Monday, May 28, 2012

ODI variables types and Variable Steps

Variable Steps

There are different variable steps within Oracle Data Integrator:
  • Declare Variable: When a variable is used in a Package (or in elements of the topology which are used in the Package), it is strongly recommended that you insert a Declare Variable step in the Package. This step explicitly declares the variable in the Package.
  • Refresh Variable: This step refreshes the variable by running the query specified in the variable definition.
  • Set Variable: There are two functions for this step:
    • Assign sets the current value of a variable.
    • Increment increases or decreases a numeric value by the specified amount.
  • Evaluate Variable: This step compares the value of the variable with a given value according to an operator. If the condition is met, then the evaluation step is true, otherwise it is false. This step allows for branching in Packages.
Declaring a Variable
To insert a Declare Variable step:
  1. Open the Package editor and go to the Diagram tab.
  2. In Designer Navigator, select the variable to add to the Package from the Projects tree for a project variable or from the Others tree for a global variable.
  3. Drag and drop the variable into the diagram. A variable step appears.
  4. Click on the step icon in the diagram. The properties panel opens.
  5. In the General tab, fill in the Step Name field. Select Declare Variable in the Step Type.
  6. From the File menu, click Save.
Refreshing a Variable
To insert a Refresh Variable step:
  1. Open the Package editor and go to the Diagram tab.
  2. In Designer Navigator, select the variable to add to the Package from the Projects tree for a project variable or from the Others tree for a global variable.
  3. Drag and drop the variable into the diagram. A variable step appears.
  4. Click on the step icon in the diagram. The properties panel opens.
  5. In the General tab, fill in the Step Name field. Select Refresh Variable in the Step Type.
  6. From the File menu, click Save.
Setting a Variable
To insert a Set Variable step:
  1. Open the Package editor and go to the Diagram tab.
  2. In Designer Navigator, select the variable to add to the Package from the Projects tree for a project variable or from the Others tree for a global variable.
  3. Drag and drop the variable into the diagram. A variable step appears.
  4. Click on the step icon in the diagram. The properties panel opens.
  5. In the General tab, fill in the Step Name field. Select Set Variable in the Step Type.
  6. Select Assign or Increment depending on the operation you want to perform on the variable value.
  7. Type in the Value field the value to set or the increment. This value may be another variable.
  8. From the File menu, click Save.
Evaluating a Variable
To insert an Evaluate Variable step:
  1. Open the Package editor and go to the Diagram tab.
  2. In Designer Navigator, select the variable to add to the Package from the Projects tree for a project variable or from the Others tree for a global variable.
  3. Drag and drop the variable into the diagram. A variable step appears.
  4. Click on the step icon in the diagram. The properties panel opens.
  5. In the General tab, fill in the Step Name field. Select Evaluate Variable in the Step Type.
  6. Select the Operator used to compare the variable value.
  7. Type in the Value field the value to compare with your variable. This value may be another variable.
    Note:
    You can specify a list of values in the Value field. When using the IN operator, use the semicolon character (;) to separate the values of a list.
  8. From the File menu, click Save.

1 comment: