Wednesday, October 30, 2013

Setting an ODI variable value to another ODI variable

Suppose I have two ODI variables var1 and var2, I want to assign var2 the value of var1.
Basically, my code should mean : var2 = var1;
But how do I do this in ODI ?
This one is a bit tricky since ODI does not allow writing '#variable' in the set variable option in package. It will throw a syntax error.
The trick here is : in the 'Refreshing' tab for var2 you should write the query like this
select #ProjectName.var1 from dual
Now, the query validation will fail, but dont worry, if you execute it by pressing the refresh button, it will execute successfully and you will be able to see the value in 'History' tab

Cheers !