1
<?
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);
?>

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.