Blog

Router Transformation in ODI

Hi Guys!!!!
Here is the post you were looking for. I had to spare few time as I was getting so many emails on this. You can refer this post if you are interested to use multiple interface for accomplishing the same. If you are thinking of a single interface then here is the solution.

Now reverse EMP,EMP_TGT1. Dont bother about that #GET_T as given in below image.We will do that part at the end.
Now create 5 odi variables CHECK_C,CHECK_T,GET_C,GET_T,LOOP
Create the interface with source as EMP and target as EMP_TGT1 and then execute it.
Once above interface will run successfully then create a filter as given in below image.
Now create a new ODI procedure with below steps.
Create a new option CONDITION_NAME in the procedure to provide the condition separated by commas.
Just right click on procedure and click on New Option.
Well now save it and come to the next step of the procedure that is insert conditions and put below codes inside it.
declare
CNT NUMBER:=0;
COND VARCHAR2(40):=’<%=odiRef.getOption(“CONDITION_NAME”)%>‘;
begin
SELECT REGEXP_COUNT(COND ,’,’ ) INTO CNT FROM DUAL;
CNT:=CNT+1;
while CNT!=0 loop
INSERT INTO CONDITION_NAME VALUES(CSEQ.NEXTVAL,REGEXP_SUBSTR ( COND, ‘[^,]+’, 1, CNT ));
CNT:=CNT-1;
end loop;
end;

INSERT INTO TABLE_NAME (TID,TNAME)
SELECT TSEQ.NEXTVAL,TABLE_NAME FROM USER_TABLES WHERE TABLE_NAME LIKE ‘EMP_TGT%’

Next open the target datastore and modify the resource name to #GET_T. This variable will read table names dynamically.You can say this is the reverse of loading multiple files to one target table where source datastore will keep this variable.
Now arrange all the object as given in below diagram.Remember 1st LOOP variable assign value=1 and in next LOOP variable increment by 1. Similarly CHECK_T variable should be greater than 0 in evaluate mode.
YOu are done. Lets execute the package.Here is the session details from operator.

Thats all guys 😀 . Nothing impossible in ODI if you can develop the logic.
Comments are welcome.

About the author

Bhabani(http://dwteam.in) - Currently Bhabani is working as Sr Development Engineer at Harman International. He has good expertise on Oracle, Oracle Data Integrator, Pervasive Data Integrator, MSBI, Talend and Java. He is also contributing in ODI-OTN forum for last 5 years. He is from India. If you want to reach him then please visit contact us page.
If you have any doubts or concerns on the above article, please put your question here. Dw Team will try to respond it as soon as possible. Also dont forget to provide your comments / suggestions / feedback for further improvement. Thanks for your time.

13 comments

Thanks Bhabani, Finally I got the post . Many many thanks for this. Its correct that this is just the reverse of reading multiple files from one folder..I dont know why it didnt came to my mind.But I like the IKM Multitable Insert 😀

Hi Bhabani,
It was 100% nice workout, but in this post all the 3 target tables descriptions same..so we can acheive using even case conditions in mapping level, but how we can do data movement to multiple targets with diffrent descriptions(linke in informatica….

Disclosure

The views expressed on this blog are those of the author and do not necessarily reflect the views of Oracle. All content and s/w code on this site are offered without any warranty, or promise of operational quality or functionality.