Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a job that does this tDBInput --> TWriteJSONField --> tJavaRow --> tFileOutputDelimited --> tJavaRow.
I the first tJavaRow I set a global variable for the file name. I also print out the variable so I can confirm it is correct.
I also have a print line in the second tJavaRow that again prints out the variable so I can confirm it is still set.
But when I use the global variable in the tFileOutputDelimited it comes across as null. If I set the global variable to a default value that default value is used in the tFileOutputDelimited filename so I know it can read the variable.
Is there a reason the tFileOutputDelimited cannot see the global variable value when it is changed?
It may be a logic thing with Talend I am not understanding. I asked Talend support and they sent me the canned response on context variables. I tried using a context variable but got the same results.
Hi
Please read this documentation page to learn the code generated mode. In this case, tFileOutputDelimited is initialized before tJavaRow, so change the job design as below, tFileOutputDelimited will have the value of global variable.
tDBInput --> TWriteJSONField --> tJavaRow -->tFlowToIterate--iterate--tFixedFlowInput--main--> tFileOutputDelimited -->
Regards
Shong
Thank you, this worked for me. And thanks for the link, it had some very useful information.