One Star

Pass parameters to jobs when executing the .sh script

Hi -
Is is possible to pass a parameter (a date, for example) to a job when it is executed by running the .sh script, or when launched through the Job Conductor in the Admin Center? - using an Oracle database
6 REPLIES
Community Manager

Re: Pass parameters to jobs when executing the .sh script

Hi
Edit the .sh script and add the context parameters like:
cd `dirname $0`
ROOT_PATH=`pwd`
java -Xms256M -Xmx1024M -cp classpath.jar: p3.executejob_0_1.ExecuteJob --context=Default --context_param name1=elise --context_param name2=shong $*

On Job Conductor, open the context tab and add the custom value. (see my screenshot)
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Pass parameters to jobs when executing the .sh script

Thanks -
One Star

Re: Pass parameters to jobs when executing the .sh script

Hi -
I want to use the variable in the query field for a tOracleInput component. How do I modify the query to use it?
SELECT ...
FROM ...
WHERE LAST_MOD_DATE > context.TheDate
One Star

Re: Pass parameters to jobs when executing the .sh script

Hi -
I want to use the variable in the query field for a tOracleInput component. How do I modify the query to use it?
SELECT ...
FROM ...
WHERE LAST_MOD_DATE > context.TheDate

I assume LAST_MOD_DATE is some date so you will be including it in query in quotes. You will be appending this context param to your query. Your query will be then
"
SELECT ...
FROM ...
WHERE LAST_MOD_DATE > '" + context.TheDate + "'"

Re: Pass parameters to jobs when executing the .sh script

Hi I need to connect to Sever such as 192.168.137.12 and then login in that server with user name and password.. point to a location and then run a Shell script.. how to proceed with the same in Talend?? Some inputs pls..
Five Stars

Re: Pass parameters to jobs when executing the .sh script

Take a look at the component tSSH. This may be what you're after.