[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!!

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

APIs for Dummies

View this on-demand webinar about APIs....

Watch Now