ODI 12c Substitution API

187 Views Asked by At

I have a mapping where I use IKM Incremental Update. In this mapping, the "Use Unique Temporary Object Name" option is checked Figure-1. In IKM Incremental Update i added a new step and write target commands codes to the KM as follows and selected "Oracle" as the technology Figure-2

Output is : ETL.I$_SRCAP6V4TE0SOLTP0UH7SHVGAD28D
Expected is : xSchema='ETL' , xTableName='X$_SRCAP6V4TE0SOLTP0UH7SHVGAD28D' , further steps how can i use this variable <%=xSchema%> and <%=xTableName%>

What I am trying to do is as follows;

Step 1-->Getting staging table's schema and assign it to a variable --> xSchema='ETL'
Step 2-->Rename staging table's name to X$ (I$ to X$) and assign it to a variable xTableName='X$_SRCAP6V4TE0SOLTP0UH7SHVGAD28D'
Step 3-->Use these variables in further steps of the IKM
<%=xTableName%>

Thanks in advance

1

There are 1 best solutions below

0
JeromeFr On

You can use Java Beanshell scripting language between the substitution tags <% and %>.

For instance the split(".") method use with would return an array with the schema in index 0 and the table name in index 1.

The scope of a Java variable in ODI is the entire mapping execution. You should be able to directly use the variable declared in one task into any following task using the same substitution tags <% and %>.

If it doesn't work with <% and %>, try with ? or $ instead. More info about substitution tags in this excellent blog by Rodrigo Radtke de Souza : https://devepm.com/2014/09/16/odi-substitution-tags-demystified/