Using Java variables in KMs
For this recipe, we will
make a very simple modification to the IKM SQL Control Append
KM using a Java variable. Then we will use this KMs in a series of interfaces to see how ODI handles the variable.
Getting ready
You will need to have a project available where the IKM SQL Control Append
KM has already been imported. You must also have a few tables that can be used as target tables using this IKM (think of 3 or 4 tables).
How to do it...
Rename the
IKM SQL Control Append
toIKM SQL Control Append with Variable
.Right-click on the
IKM SQL Control Append with Variable
KM and add New option. Call this optionReset Java Variable
. Set the type to Check Box and the default value toFALSE
.Edit the KM
IKM SQL Control Append with variable
and add a step. Name the stepReset Java Variable
and write the following code in that step:<%=my_var=0%>
Because this step will not end up generating any code to be executed by a database or external tool, leave the technology as...