About Talend

Talend Open Studio operates as a code generator allowing data transformation scripts and underlying programs to be generated either in Java (OR) Perl. Its GUI is made of a metadata repository and a graphical designer. The metadata repository contains the definitions and configuration for each job. The information in the metadata repository is used by all of the components of Talend Open Studio.

Course Details : http://talend-training.blogspot.in/2013/04/talend-training-course-details.html

Showing posts with label incremental load in talend. Show all posts
Showing posts with label incremental load in talend. Show all posts

Make one Value as Context Variable in Talend

My Incremental Load Logic using context variable(with maxid) in Talend


I faced one problem for making my value as variable. below is the scenario.


I am doing my incremental load job and this will be based on  one auto incremented column.  I need to get the data from my source based on last inserted id in my target database ( After full load execution ). For this I need to get the max value for that id from target database and then i need to use that value in my select statement  with greater than condition in Source Database.


To Resolve this I have created Context variable . 
Then get the  max id from source database  and stored in variable.
Used this variable in my Select Statement for getting only Delta(new) data


Steps:
  • Created contextvariable 
  • Created MysqlInput job to query for max row as maxidfield
  • Created tJavaRow job  to assign the variable  context.setProperty("contextvariable",row1.maxidfield)
  • Then Run, MySqlInput job with an amended query:  "SELECT ... FROM .... where id > "+(String)((String)context.getProperty("contextvariable"))