How to select Max from a DB table and store it in context variable

How to select Max from a DB table and store it in context variable

In this example, you will find a way how to query a database , extract the maximum for a specific ID then store into a context variable.

 

first of all, prepare the query and paste it into the iMysqlInput ( or any input, depending on your database ):

SELECT coalesce(max(ID),0) as MAXID FROM TABLE

now we have the maximum, we will add a tJavaRow component and link it with the iMysqlInput as the following

MaxID talend

 

 

 

 

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.