[resolved] the AFTER global variable for tMSSQLOutput returning NULL

Highlighted
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
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 Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

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