Search code examples
oracle-data-integrator

OdiOSCommand assign variable


I have OdiOSCommand with command :

OdiOSCommand "-ERR_FILE=/home/oracle/jmt.err" "-WORKING_DIR=#PROJECT_DIR" "-SYNCHRONOUS=YES" "-CAPTURE_OUT_STREAM=ON_ERROR[NONE]" "-CAPTURE_ERR_STREAM=ON_ERROR[NONE]"
#TEMP = "hello world !"

But this way of assigning doesn't work.

The same problem is in echo "something" > #TEMP . This won't do anything.

#TEMP still contains only default value.

Do I need special syntax to manipulate ODI Variables in commands ? Could you give me example how can I assign value to ODI variable ?

Thank you very much.


Solution

  • No other ways to change an ODI variable except two possibilities:

    1. use Variable step with type Refresh Variable
    2. use Variable step with type Set Variable

    Drag and drop Variable into a package and choose proper type on General tab in Properties window.

    If you are looking for more flexible mechanism for storing values in the memory during the session, you may use Java BeanShell substitutions. Anywehere you can write

    <@TEMP="Hello world!"@>
    

    This substitution will disappear on execution, but TEMP variable will keep assigned value while session is running. Somewhere in further steps you can write

    <@=TEMP@>
    

    And now the substitution is replaced by current value of the variable. You may use such constructions in ODI variable assignment or refreshment as well.