[resolved] need help records are inserted/updated

One Star

[resolved] need help records are inserted/updated

Hi,
I need a help to how to send a mail with how many records are inserted/updated in specific table. I design the job but unable to achieve the functionality.
could you please help me.
thx

Accepted Solutions
Moderator

Re: [resolved] need help records are inserted/updated

Hi,
If you set the Action on data on DB is "Update or Insert", there is a Key schema needed for this table.
Perhaps the tsendmail message body should be :
"The inserted number"+((Integer)globalMap.get("tMysqlOutput_1_NB_LINE_INSERTED"))+"The Updated number"+((Integer)globalMap.get("tMysqlOutput_1_NB_LINE_UPDATED"))

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

All Replies
Seven Stars

Re: [resolved] need help records are inserted/updated

Connect tSendMail with OnComponentOK from the second tOracleOutput or with OnSubjobOK from the first tOracleInput.
Moderator

Re: [resolved] need help records are inserted/updated

Hi,
In addition, Nb_LINE is used to count the total number of records have been proceed. When inserted item is choosen, there will be a global variale such as ((Integer)globalMap.get("tOracleoutput_1_NB_LINE_INSERTED")) will be avaible, which counts the total number of records have been inserted into database. The same to updated, deleted items.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] need help records are inserted/updated

Hi,
In tsendmail message body i have to use global variable ((Integer)globalMap.get("tOracleoutput_1_NB_LINE_INSERTED")). Could you please help me.

Thx
Moderator

Re: [resolved] need help records are inserted/updated

Hi,
You can set the expression of body as:
""+((Integer)globalMap.get("tMysqlOutput_1_NB_LINE_INSERTED"))
or
"The total number of processed files is: "+((Integer)globalMap.get("tMysqlOutput_1_NB_LINE_INSERTED")).
String.valueOf((Integer)globalMap.get("tMysqlOutput_1_NB_LINE_INSERTED")) is also Ok.
See my screenshot
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] need help records are inserted/updated

Hi sabrina,
Thanks for inputs. however i want to use a single tsendmail component and in that message body i have to use no. of records inserted and no. of records updated. Is it possible?
could you please help me.
Thx
Moderator

Re: [resolved] need help records are inserted/updated

Hi,
Thanks for inputs. however i want to use a single tsendmail component and in that message body i have to use no. of records inserted and no. of records updated. Is it possible?

no.of record inserted and no. of records updated? How did you set your DB "Action on data" if you want both of them? Could you please elaborate your case with an example with expected output values?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] need help records are inserted/updated

Hi sabrina,
Yes. I want both of them. I set the Action on data on DB is "Update or Insert". So i want to capture no. of records inserted and no.of records updated in tsendmail message body. could you please advise or help me.
Thx,
Moderator

Re: [resolved] need help records are inserted/updated

Hi,
If you set the Action on data on DB is "Update or Insert", there is a Key schema needed for this table.
Perhaps the tsendmail message body should be :
"The inserted number"+((Integer)globalMap.get("tMysqlOutput_1_NB_LINE_INSERTED"))+"The Updated number"+((Integer)globalMap.get("tMysqlOutput_1_NB_LINE_UPDATED"))

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.