Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I currently have two separate jobs that load data into the same destination database, but they come from two different sources - Source1 and Source2. Source1 and Source2 each have their own token drop. Both of these jobs have the same queries and grab from identically built tables.
I need to combine these two jobs into a single job that, based on the individual token drops, will pass the correct parameters into the job and pull from the correct source. So, if the token for Source2 drops, the job will need to run with Source2 connection information.
How would I set up and pass these parameters through the job?
TYIA!
Hi
Using context variables to configure the DB parameter, assign corresponding value to context variable based on the individual token drops, I don't know how the token drops comes in your job, just give an simple example to explain the logic process:
tJava
|onsubjobok
tDBInput...>tDBoutput
on tJava:
...balabalabala..get your token drops and analyse its value...
if(token.equals("Source1"){
context.host="host1";
context.database="database1";
..other context variables....
}else{
context.host="host2";
context.database="database2";
..other context variables....
}
Regards
Shong
Thanks, I will give this a go and get back to you.
@shong wrote:
Hi
Using context variables to configure the DB parameter, assign corresponding value to context variable based on the individual token drops, I don't know how the token drops comes in your job, just give an simple example to explain the logic process:
tJava
|onsubjobok
tDBInput...>tDBoutput
on tJava:
...balabalabala..get your token drops and analyse its value...
if(token.equals("Source1"){
context.host="host1";
context.database="database1";
..other context variables....
}else{
context.host="host2";
context.database="database2";
..other context variables....
}
Regards
Shong