After an insert in a table in a SQLServer Database, I want to display the number of records inserted
So I use the global variable ((Integer)globalMap.get("tMSSqlOutput_2_NB_LINE_INSERTED"))
and I get Null as result.
I have check in the table the row is inserted!
Where is my misstake?
Thanks
Hi
The variable have to be used in the next subjob rather than child job, so change the job as seen below, you should be able to get the value of the global variable.
For example:
tFileFetch
|
onsubjobok
|
your main processing---tMssqlOutput_1
|
onsubjobok
|
tFixedFlowInput--main--tLogRow
on tFixedFlowInput, you get the number of lines which has been updated/inserted/deleted on tMssqlOutput, to do it: define one column called it nb_inserted, and set its values as:
((Integer)globalMap.get("tMSSqlOutput_1_NB_LINE_INSERTED"))
Regards
Shong
Hi
It is not a bug, this kind of global variable should be used in next subjob, if you look into the generated code of job, you will see the the code
((Integer)globalMap.get("tMSSqlOutput_1_NB_LINE_UPDATED")) on tMap_3 is executed before putting value to the global variable in the end part of tMssqlOutput, so you need to change the job design, eg:
....tMSSQLOutput--tHashOutput
|
onsubjobok
|
tHashInput--main--tMap_3....
Hi
The variable have to be used in the next subjob rather than child job, so change the job as seen below, you should be able to get the value of the global variable.
For example:
tFileFetch
|
onsubjobok
|
your main processing---tMssqlOutput_1
|
onsubjobok
|
tFixedFlowInput--main--tLogRow
on tFixedFlowInput, you get the number of lines which has been updated/inserted/deleted on tMssqlOutput, to do it: define one column called it nb_inserted, and set its values as:
((Integer)globalMap.get("tMSSqlOutput_1_NB_LINE_INSERTED"))
Regards
Shong