英文:
Variable value assignment in Oracle Data Integrator
问题
Sure, here are the translated parts:
String mystr = "#MY_ODI_VAR";
out.print(mystr);
String mystr = "<% #MY_ODI_VAR %>";
out.print(mystr);
String mystr = "<% \"#MY_ODI_VAR\" %>";
out.print(mystr);
英文:
<?
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
得分: 0
Sure, here is the translated content:
使用问号标记 <? ?>
会在替换 ODI 变量之前生成代码。
相反,使用美元标记 <$ $>
应该有效。它会在替换 ODI 变量之后生成代码。
<$
String mystr = "#MY_ODI_VAR";
out.print(mystr);
$>
这里有一个关于4种不同替换标记的更详细解释。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论