Sharing Knlowledge With The World…

Month: December 2013

Multiple Columns From UnConnected Lookup

overall
Hello Readers,

                      Today we will be a discussing a scenario of getting Multiple Columns From UnConnected Lookup  in Informatica.
Normally an unconnected lookup only returns a single column from the lookup source that is referring to. But you can return multiple column using an unconnected lookup if your lookup source is TABLE using a query override feature.

Overall Job Desc:- Multiple Columns From UnConnected Lookup

Multiple Columns From UnConnected Lookup

Multiple Columns From UnConnected Lookup

Now In Lookup Transformation use override sql query feature and create an additional port which will going to be the return port and override the sql query as given below.

Multiple Columns From UnConnected Lookup

Multiple Columns From UnConnected Lookup

 

SELECT S_ULOOKUP_REAL.AGEas AGE
               , S_ULOOKUP_REAL.NAME as NAME
               , S_ULOOKUP_REAL.ADDRESS as ADDRESS
               , S_ULOOKUP_REAL.ID as ID 
               ,name||’,’||address||’,’||age as DATA
FROM S_ULOOKUP_REAL;

My last column(alias data) contains all the data and it has all those ports concatenated, which has to to be returned from the unconnected lookup make sure the port which you have created must share same name as data in our case  and it must be your return port.

Now call your Lookup Using :LKP.LKPTRANS(ID) , and then you can separate your column values using String Functions like SUBSTR() and many more…

so. this is how you can return Multiple Columns From UnConnected Lookup …

Thanks For Reading…..
Author:- Ankit Kansal & Nayan Naik




Continue Reading

User Define Function In Talend

first_func
Hello Readers,
Talend list of unique features also includes writing your own set of functions, which provides you great flexibility in your work , and one of its feature that is widely used is “User Define Function In Talend
STEPS:-
1) In left panel of the environment right click the routines tab and create routine by providing suitable names such as user_sum.
(you can write any routine name as per your requirement but it should make sense for better understandablity)
2) Create a desired function to achieve your desired functionality like f_sum.

User Define Function In Talend

User Define Function In Talend

(you can create any function as per your requirement)

Note : – Use of static keyword while creating function helps in calling a that function without creating a object for that class. If you do not specify static keyword while creating a function then it becomes mandatory for you to call that function by first creating an object for that class.

3)Call to a function

User Define Function In Talend

User Define Function In Talend

In this job our function f_sum takes two numbers and returns the sum for those two numbers. A call is made to function in tMap describing by the image given below.

User Define Function In Talend

User Define Function In Talend

however you can use this function at any place inside the job where talend permits to write your own code or to use methods.
 CALLING A FUNCTION : – user_sum.f_sum(row1.first, row1.second)
 
You can also create/import libraries from outside which contains Classes and functions and after importing those libraries into your job you can use features from those…
So, this how you can create and use “User Define Function In Talend” and use them in different situations.
Thanks For Reading……

Talend Interview Questions
Author:- Ankit Kansal & Nayan Naik
Continue Reading

Initializing Context At Run Time Using Popup

complete_job_desc
Hello Readers,

                       Today, we will discussing a basic functionality for Talend Open Studio, which can be very much useful and can be implemented wide range of scenarios.
Initializing Context At Run Time Using Popup window.
Overall Job Info : –
Initializing Context At Run Time Using Popup

Initializing Context At Run Time Using Popup

PROBLEM: –
It happens to most of the times that your business logic remains the same but your parameters such as file name, db name, passwords e.t.c. changes frequently, and to make the things workout either you have to make changes in the Default.properties  or you have to open the Talend  Studio and make explicit changes  to run the job.
SOLUTION :-
Talend provides a simple solution by providing a context prompt option to your variables thus every time you run your job a popup-window will appear and there u just need to simply put your values.
Initializing Context At Run Time Using Popup

Initializing Context At Run Time Using Popup

Just click on the prompt tab in front of the variable and check the text box for those variable who you want to assign values dynamically..
RUN JOB : –
This is how it looks during RUN time.
Initializing Context At Run Time Using Popup

Initializing Context At Run Time Using Popup

This way you can overcome most of the basic problems occurs during your development and execution….

Thanks For Reading……

Talend Interview Questions

Author:- Ankit Kansal & Nayan Naik
Continue Reading
PageLines