One Star

Find number of rows returned from tMySQLRow

Hello,
I've noticed many variables produced from other components by way of getGlobal().
I'm wondering if it's possible to find the number of rows returned by a tMySQLRow or tMySQLInput?
Thank you
-Joe
5 REPLIES
Moderator

Re: Find number of rows returned from tMySQLRow

Hi,
Talend has default global variables of processed row number for component(see my pic), the number of row is produced when the job are running, so you cannot set one by getGlobal() tSetGlobalVar.
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: Find number of rows returned from tMySQLRow

This doesn't seem to be the case when I run my job. I am able to get QUERY, however I am not able to get NB_LINE. See attached image.
my code from tFixedFlowInput:
context.iNextID
((Integer)globalMap.get("tMSsqlInput_1_NB_LINE"))
((String)globalMap.get("tMSSqlInput_1_QUERY"))
Six Stars

Re: Find number of rows returned from tMySQLRow

Looks like a typo, ((Integer)globalMap.get("tMSsqlInput_1_NB_LINE"))
^Capitalize Me
Smiley Happy
One Star

Re: Find number of rows returned from tMySQLRow

Genius!
Much appreciated jholman! Indeed that was the problem.
Smiley Surprised
Moderator

Re: Find number of rows returned from tMySQLRow

Hi jpetsche,
You can use an existing global variable or context variable in any component properties field. Press Ctrl+Space bar to display the full list of global and context variables used in various predefined Java functions. That way will avoid typo issue.
In addition, could you please mark this topic as"resolved"?
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.