Context Variable

One Star

Context Variable

hi,
I created one talend job, wic have 4 context variable. now i exported the job. after exporting job i got shell script (.sh file).
i want to pass value of context variable as manually. i know how to pass value i.e. --context_param backup_path=/root/abc .
now i still have context variable 'source,dest,failure'... how to assign value to these remain three???
Regards,
Akshath Hegde
Moderator

Re: Context Variable

Hi,
Open the your executable file, xxx.sh on Unix / Linux. Assign value to these three context variables 'source,dest,failure' as
--context_param source=xxx --context_param dest=xxx --context_param failure=xxx in your .sh file.
Let me 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.
Highlighted
One Star

Re: Context Variable

hi,
Thank you for quick reply Sabrina. Now in script i gave like this,
--context_param source=xxx dest=xxx failure=xxx
And its working. Now which one i should use? which is prepared by talend???
Regards,
Akshath Hegde
Moderator

Re: Context Variable

Hi,
Now which one i should use? which is prepared by talend???

What's your expected result? Don't you pass value of context variable as manually? Could you give us more description about your current job and requirement.
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: Context Variable

hi,
I have perl program which call this shell script. so in perl code im passing command line argument so shell script as follows,
`sh xxx.sh \root\source \root\dest \root\fail`
and in shell script i wrote as follows,

--context_param source=${1} dest=${2} failure=${3}
now everything is working fine.
but you told in previous comment different syntax and im using different syntax. my question is "which is better way to use --context_param?? with first variable or with every context variable ??"
Regards,
Akshath Hegde
Moderator

Re: Context Variable

Hi,
They are both working for you?
--context_param source=xxx dest=xxx failure=xxx
or --context_param source=xxx --context_param dest=xxx --context_param failure=xxx

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: Context Variable

hi,
yes sabrina. i tested using both method its working fine.
Regards,
Akshath Hegde
Moderator

Re: Context Variable

Hi,
Usually, we use context_param source=xxx --context_param dest=xxx --context_param failure=xxx parameter in .bat/.sh file.
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.

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch