Today we discuss how to return muliple values using Unconnected lookup. First of all, the UnConnected lookup has one return port and returns one column from each row. If the interviewer asked the above scenario, follow the below solution.
- Let us assume EMP will be source table and DEPT will be LOOKUP table.
- Create a target table T_UNCONN_LKP in target designer. Table should contain all ports of EMP table plus DNAME and LOC.
- Go to the Mapping Designer and create the mapping with source, target, lookup and expression transformations as shown below:
- Then concatnate multiple ports with the separator '&' into single port in Lookup transformation.
- To do edit Lookup transformation and create a return port (DNAME).
- Then go to Properties tab, there write the following expression in Lookup SQL Over.
SELECT dname||'&'||loc FROM dept |
- In expression transformation spilt it into multiple ports as follow.
- Declare 2 output variables with
o_DName = SUBSTR (dname, 1, (INSTR(dname, '&', 1)) o_Loc = SUBSTR(dname, INSTR (dname, '&')) |
- Connect all ports from Expression transformation to target table.
Excellent work!
ReplyDeletenice....
ReplyDeleteVery nice explaination.
ReplyDeleteBut, I have one more problem. If i am flat files then SQL override option will be disabled. Can somebody tell me how to do this with flat files????
Nice article.
ReplyDeletefor informatica interview questions and answers click here
This is very informative and this is very usefull to us.
ReplyDeleteInformatica online training , informatica training in bangalore
informatica online training , informatica training in bangalore , informatica training , informatica online trainig in bangalore
This is very good information
ReplyDeleteinformatica training , infromatica online training, informatica training in bangalore, infromatica online training in bangalore