Find number of rows returned from tMySQLRow

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
Highlighted
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"))
Seven 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.

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads