One Star

How to count number of rows affected (created/updated) by tMySQLSCD..?

Is there a way to know the number of rows that an SCD component (::such as tMySQLSCD) affects? (::affect meaning updates and/or creates)
I tried to put a 'tFlowMeter' after a tMySQLSCD, but that doesn't work since the tMySQLSCD does not output a Main Row.
Thanks and cheers!
-Enrique
7 REPLIES
One Star

Re: How to count number of rows affected (created/updated) by tMySQLSCD..?

Hi, did you get a chance to get this, I am trying to get the number of rows updated and inserted using the tscd component, if so please let me know. thanks in advance.
One Star

Re: How to count number of rows affected (created/updated) by tMySQLSCD..?

*bump* have the same question.
One Star

Re: How to count number of rows affected (created/updated) by tMySQLSCD..?

Hi,
There should be two variable available after the component runs: NB_LINE_UPDATED and NB_LINE_INSERTED accessible through ((Integer)globalMap.get("tMySqlSCDOutput_1_NB_LINE_INSERTED"))
Hope this helps.
Regards,
Arno
One Star

Re: How to count number of rows affected (created/updated) by tMySQLSCD..?

Hi avdbrink, where/how could I use these variables? Can I see this in the console for example?
Seventeen Stars

Re: How to count number of rows affected (created/updated) by tMySQLSCD..?

No these variables are not per se visible in the console. You have to use e.g. a tWarn component (switch level to Info) and here you can use these variables combined with a nice text.
One Star

Re: How to count number of rows affected (created/updated) by tMySQLSCD..?

Hi thanks, I tried attaching tMysqlOutput to tWarn and put one of the global variables into the Message field, but I got this (see screen captures)
EDIT: I've consolidated to my new thread here http://www.talendforge.org/forum/viewtopic.php?pid=122941#p122941
Seventeen Stars

Re: How to count number of rows affected (created/updated) by tMySQLSCD..?

Yes because the field in the tWarn expect a String and not an Integer. You can fix that by adding an empty String in front of your counter.
"" + ((Integer) globalMap.get("tMysqlSCDOutput_1_NB_LINE_INSERTED"))

And a good advise: Start learning what you use. Your questions let me think you have nothing studied from the help material and I strongly suggest start learning Java.