Error using internal variables

Highlighted
Four Stars JFS
Four Stars

Error using internal variables

Hello,

 

I'm created a simple enough mapping that sets a fiew context variables dynamically using a tContextLoad, then uses a query to read some records from an Oracle table, goes through a tMap and to a tDBOutput. 

 

Everything works great, no errors, I see the data in the target table. 

 

Now I want to log the results, whether the tDBOutput inserted without errors or returned an error.

 

My plan was to use a tFixedFlowInput triggered by OnComponentOK from the tDBOutput and set the column values for my log table. Some variables are coming from the context variables and that works fine.

 

I hit issues when I try to use the internal variables from my SQL queries and output. I use the auto-complete to make sure I get the proper syntax:

internal((Integer)globalMap.get("tDBInput_1_NB_LINE")) 

internal((Integer)globalMap.get("tDBOutput_1_NB_LINE_INSERTED"))

internal((String)globalMap.get("tDBOutput_1_ERROR_MESSAGE"))

 

I get errors run time :

 

Error in the component's properties:The method internal(Integer) is undefined for the type MyJobName
The method internal(Integer) is undefined for the type MyJobName
The method internal(String) is undefined for the type MyJobName

 

I tried a number of things but can't figure out where I can use those internal variables and somehow output that somewhere.

 

Any idea?

 

Thanks.

 

JFS.


Accepted Solutions
Four Stars JFS
Four Stars

Re: Error using internal variables

I found the problem. 

 

My plan worked. The issue was in the syntax itself of those internal variables. 

 

Where I got : internal((Integer)globalMap.get("tDBInput_1_NB_LINE"))  I needed only (Integer)globalMap.get("tDBInput_1_NB_LINE") and voilà. 

 

I used "internal" because I had seen this in another post while searching how to ouput this kind of data. 

 

Cheers,

 

JFS.


All Replies
Four Stars JFS
Four Stars

Re: Error using internal variables

I found the problem. 

 

My plan worked. The issue was in the syntax itself of those internal variables. 

 

Where I got : internal((Integer)globalMap.get("tDBInput_1_NB_LINE"))  I needed only (Integer)globalMap.get("tDBInput_1_NB_LINE") and voilà. 

 

I used "internal" because I had seen this in another post while searching how to ouput this kind of data. 

 

Cheers,

 

JFS.

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 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 3

Read about some useful Context Variable ideas

Blog