ODIExperts.com

The blog for Oracle Data Integrator ( ODI )

Find the Value of the Variable in Operator ?

In ODI  value of the variable is calculated at the run time but not shown in the operator.

Please find this ODI procedure using Jython to show the value of the Variable.

Step 1

Create an ODI Procedure and Insert an option called  “VAR” and give the default as

<%=odiRef.getPrevStepLog("STEP_NAME")%> , reason being so that by default when using this procedure after the variable, ODI  automatically  takes the name and throws the variable value in Operator .

image

Create another Option called “PROJECT” and give the default value as your project code. The reason i have created an option for Project code is that so that you can modify in the option without any need for change in code also you can use for global variables too.

image

Step 2 .

Add an option  in the ODI procedure  and give the technology – Jython  and check “ Ignore Errors “ and paste the following code

raise  ‘  n THE VALUE OF THE VARIABLE <%=odiRef.getOption("VAR")%>  IS  –  <%=#odiRef.getOption("PROJECT")%>.<%=odiRef.getOption("VAR")%> ‘

make sure that everything inside the raise command  have single quotes before and after .

Lets test this Procedure.

image

and for Jython is

image

image

This above example shows that i want to find the value of  variable of  variable other than the previous step , just change the var value to that name of the required variable.

image

hope this helps who are looking for a way to know the value of the variable at run time.

For global variables you don’t need to mention the project code. Just type ‘GLOBAL’ instead of the project code.

image

 image

 

Please find below the codes ,download and all you would need to do is to change your default project codes in the option from XMT to whatever desired and you can make any kind of changes desired.

Just import in an Insert_Update mode and change the project code to your default.

 

VALUE OF VARIABLE – JYTHON

http://cid-d7195c8badc40d0b.skydrive.live.com/embedicon.aspx/odiexperts.com/TRT_VALUE_OF_VARIABLE_JYTHON.xml

Leave a Reply

Required fields are marked *.


This site uses Akismet to reduce spam. Learn how your comment data is processed.