Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am beginner in Talend , So need help
From the source I have ID column and I need to store the max value of ID into the context variable and use it in the query in the source in next run like as below
where clause as where ID > "+context.Max_ID+"
Please guide me how I can implement this
Could you pls help me in steps
Suppose you have a property file which contains the last Max_ID you've queried:
Key;Value Max_ID;100
When the job starts, you can get the content from this file to populate your Max_ID context variable using tFileInputDelimited + tContextLoad components:
Now you can use the current Max_ID value in your query where clause.
From the result, you have to retrieve the new max value to update the Max_ID variable (using a tJavaRow or something else).
Finally, use a tContextDump to dump all the context variables, tFilterRow to keep only the key "Max_ID" and tFileOutputDelimited to overwrite the initial property file with the new Max_ID value:
@Karuetl did this help you? If so, thank's to mark you case as Solved (Kudos also accepted)