[resolved] Passing multiple parameters on each job run

One Star

[resolved] Passing multiple parameters on each job run

Hi
In my ETL environment I have a job that have to use multiple parameters. Parameters like param1, param2, .. param10. They are used inside job in sql scripts and components.
Each time job run i have to initialize that parameter list with some values.
These values are stored in database.
Should i do these through context param file?
I thought to fill context file each time automatically with shell scripts. But see some problems like that the folder, where context file lies, could change its name, because it has job version in its name.

Accepted Solutions
One Star

Re: [resolved] Passing multiple parameters on each job run

Ok
seems like I've resolved my issues with implicit context.

All Replies
Moderator

Re: [resolved] Passing multiple parameters on each job run

Hi,
Have you already checked talend Implicit context load or tContextLoad which is used to load context parameters dynamically at the time of Job execution?
You can save values in a file or DB table.
TalendHelpCenter:Using the Implicit Context Load feature

Let us know if it is Ok with you.
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.
One Star

Re: [resolved] Passing multiple parameters on each job run

It seems that it could help me but i've got some problems.
Do you have more detailed, reference-like description of these feature and not just example?
I've set up a test job and got error:
Error: Parameter "LOAD_ID" has not been set by Implicit_Context_Context
In database i have a table with parameters of following structure
create table PARAMS(key varchar2(100),
value varchar2(100),
job_name varchar2(100));
insert into params values('LOAD_ID', '1', 'MY_JOB_NAME');
Third column job_name i need to store parameters for different jobs.
Seems like problem could be that my table for params has three columns. Not two (key, value) like in example.
But in job run log i don't see detailed log. What query it runs to get context from database, etc. Just Error.
One Star

Re: [resolved] Passing multiple parameters on each job run

In description of tContextLoad i don't see that it can load params from database.
help.talend.com/display/TalendOpenStudioforDataIntegrationUserGuide61EN/C.3.1+Preparing+context+parameter+sources
Just flat file
Moderator

Re: [resolved] Passing multiple parameters on each job run

Hi,
Here is a related forum:https://www.talendforge.org/forum/viewtopic.php?id=35478 about how to use Implicit tContextLoad in talend.
From component reference TalendHelpCenter:tContextLoad, you can change the input file component into a DB input component to read the parameter from DB table.
The work flow should be:t<DB>Input-->tcontextload
                                   |
                                      onsubjobOk
                                            |
                                   your other subjob
In addition, Implicit context load equals to use tContextLoad component in job.
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.
One Star

Re: [resolved] Passing multiple parameters on each job run

Ok
seems like I've resolved my issues with implicit context.
Moderator

Re: [resolved] Passing multiple parameters on each job run

Hi,
Can we consider this topic as resolved?
Feel free to let us know if there is any problem in your job.
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.