Six Stars

track no of rows inserted or rejected

hello,

i have multiple source file 2 csv 1 delimated and by using tmap loading data into mysqldb. now i want to create a table/file  which is  track no of rows inserted or rejected . can you plz suggest me the any component or any process to track no of rows inserted/ rejected.

 

Thanks

Vitspl

4 REPLIES
Fifteen Stars

Re: track no of rows inserted or rejected

All input and output components have globalMap variables associated with them that keep these counts. As an example, the tMSSqlOutput has the following (assuming the tMSSqlOutput is called "tMSSqlOutput_").....

 

((Integer)globalMap.get("tMSSqlOutput_1_NB_LINE_REJECTED"))
((Integer)globalMap.get("tMSSqlOutput_1_NB_LINE_UPDATED"))
((Integer)globalMap.get("tMSSqlOutput_1_NB_LINE_INSERTED"))
((Integer)globalMap.get("tMSSqlOutput_1_NB_LINE_DELETED")) ((Integer)globalMap.get("tMSSqlOutput_1_NB_LINE")) ((String)globalMap.get("tMSSqlOutput_1_ERROR_MESSAGE"))

 These are available for all database output components (all components have some of these globalMap variables). You can find them in the "Outline" window of your Studio (bottom left) and you can drag them onto a tJava so that you do not have to write them (drag them to a tJava, copy and paste them wherever you want to use them).

Rilhia Solutions
Six Stars

Re: track no of rows inserted or rejected

thanks for reply sir,

it gives null on 1st table [phonecount] and also on output gives null,see on 2nd screenshoot.

 

 

helloimage.pngimage.png

Fifteen Stars

Re: track no of rows inserted or rejected

In order to use these accurately you will need to use them in a SubJob that runs after the SubJob doing the work. The globalMap variables cannot be guaranteed to be accurate until the components they are storing totals for, are complete. Basically carry out the DB write in a subjob after the Excel read and write.

Rilhia Solutions
Six Stars

Re: track no of rows inserted or rejected

@rhall_2_0 ,@TRF hello sir, after apply all  conditions, getting as output only 1 row, but in pic i want this records as in output file plz help

 

image.png

Tags (3)