[resolved] the AFTER global variable for tMSSQLOutput returning NULL

One Star

[resolved] the AFTER global variable for tMSSQLOutput returning NULL

Hi,
I have a job where I am inserting rows from a csv to a SQL table.
Although rows have been inserted in the table, the NB_LINE_INSERTED is returning NULL.
Am I doing something wrong?


Regards,
Namrata

Accepted Solutions
Community Manager

Re: [resolved] the AFTER global variable for tMSSQLOutput returning NULL

This variable can be only available in the next subjob, for example:
.......main--tMssqlOutput
   |
onsubjobok
   |
tJava
on tJava: 
int inserted_line=((Integer)globalMap.get("tMSSqlOutput_1_NB_LINE_INSERTED"));
System.out.println(inserted_line);
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Community Manager

Re: [resolved] the AFTER global variable for tMSSQLOutput returning NULL

This variable can be only available in the next subjob, for example:
.......main--tMssqlOutput
   |
onsubjobok
   |
tJava
on tJava: 
int inserted_line=((Integer)globalMap.get("tMSSqlOutput_1_NB_LINE_INSERTED"));
System.out.println(inserted_line);
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Community Manager

Re: [resolved] the AFTER global variable for tMSSQLOutput returning NULL

This variable can be only available in the next subjob, for example:
.......main--tMssqlOutput
   |
onsubjobok
   |
tJava
on tJava: 
int inserted_line=((Integer)globalMap.get("tMSSqlOutput_1_NB_LINE_INSERTED"));
System.out.println(inserted_line);
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Highlighted
One Star

Re: [resolved] the AFTER global variable for tMSSQLOutput returning NULL

Works like a charm!!
I can be certain I had tried it before and hadn't worked though Smiley Happy
Thanks!!

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

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch