<?
String mystr = "#MY_ODI_VAR";
out.print(mystr);
?>
I want to assign value stored in an ODI variable (MY_ODI_VAR) to another variable (mystr) defined inside Java Code in a procedure. How can this be done. The above mentioned code is producing #MY_ODI_VAR instead of the value assigned to this variable. I have also tried following variations, but no luck.
Thanks
<?
String mystr = "<% #MY_ODI_VAR %>";
out.print(mystr);
?>
<?
String mystr = <% "#MY_ODI_VAR" %>;
out.print(mystr);
?>
With the question mark tags <? ?>
the code is generated before ODI variables are substituted.
Using the dollar tags <$ $>
instead should work. It generates the code after ODI variables are substitued.
<$
String mystr = "#MY_ODI_VAR";
out.print(mystr);
$>
Here is a longer explaination about the 4 different substitution tags.