Four Stars

Multiple context groups in a job

I need to use 3 separate DB connections in my job. I do not want to hard code the connection details & hence plan to use the context variables & 3 context groups. How can I ensure that when the same context environment is selected it gets reflected in all context groups?

  • Data Integration
6 REPLIES
Nine Stars

Re: Multiple context groups in a job

Environment affected to all groups and standalone context variables in Job

 

but You can easy - load values from csv file and do not store nothing in Studio, only variables names

-----------
Four Stars

Re: Multiple context groups in a job

Can you plz help how to read from CSV files & then read in my job.
Nine Stars TRF
Nine Stars

Re: Multiple context groups in a job

Can you detail your question?

TRF
Moderator

Re: Multiple context groups in a job

Hi,

You can refer to the related scenario "Reading data from different MySQL databases using dynamically loaded connection parameters

" in component reference about: TalendHelpCenter:tContextLoad 

 or the implicit context feature TalendHelpCenter:Configuring the Implicit Context Load feature.

Best regards

Sabrina

 

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: Multiple context groups in a job

Team, How to implement the same logic for a job already built and exported, in that case the prompt will be coming ? I have a scenario where the source and target path of the job keeps changing based on the environment. So i have that path in a config file like below, which I will change based on the environment. Config File : source;C:/users/temp/ target;C:/users/name/ Now in real time how to use this file to resolve the context variables.
Nine Stars TRF
Nine Stars

Re: Multiple context groups in a job

You just have to read the config file with tFileInputDelimited then use a tJavaRow component to set the desired context variables with the field values like this "context.yourVariable = input_row.yourField;".

Hope this helps.

TRF