Friday, 22 February 2013
Talend: Fetch records deleted by tjdbcoutput component (or other database output) in talend and storing it to global variable
Fetching number of records deleted/inserted by tjdbcoutput component (or any other tDatabaseoutput comonent) and performing mathematical operation of addition and saving this value to global variable
tJDBCOutput_1 - is our output component.
tJDBCOutput_2 - is our another output component.
DEL_ROW_COUNT - is our global variable to store deleted row by above two components
Talend provides NB_Line_Inserted/Deleted/Updated variables for different database output components which we can use after the component has finished.
What we will do is on subJobOk of these components we use java code in tJava component, where we use java functions to get value of these NB_Line* variables and do mathematical operation and store final value to global variable.
Java code is below