#1 2011-10-11 22:58:53

alphamanic
Guest

External properties file

hi,

I have a flat file that needs to be loaded into the database. I can use talend open studio in my dev env where I can specify the location ("hard code"). This location will be different for my production environment. How can I specify the location in the properties file so that when my standlone job executes it looks into the properties file.

#2 2011-10-11 23:07:39

walkerca
Member
Company: Bekwam, Inc.
Registered: 2011-01-12
Posts: 253
Website

Re: External properties file

Define a context variable 'context.PROPSFILE' and set it to your default dev location (say C:\dev).

In the production environment, override the variable by passing in --context_param PROPSFILE=/opt/productionloc to the run script.

Another option is to set up dev, test, and prod contexts and store three different values in the job.  Then, select the environment with --context.


Visit bekwam.blogspot.com for Talend topics and tutorials.  Twitter @bekwaminc for updates.

Offline

#3 2011-10-11 23:14:03

alphamanic
Guest

Re: External properties file

thanks, but how can I use this context? - for example

I have my CSV file defined via metadata -> file delimited.
When I create a job and create a tfileinputdelimited
under the component basic settings -> filename/stream - i already see this been hard coded to my dev env.

do you an example anywhere i can take a look at?

#4 2011-10-11 23:16:56

alphamanic
Guest

Re: External properties file

ahh, just saw the tutorial section on Working with global context variables

http://www.talendforge.org/tutorials/tutorial.php?language=english&idTuto=34

Thanks

#5 2011-10-11 23:18:03

walkerca
Member
Company: Bekwam, Inc.
Registered: 2011-01-12
Posts: 253
Website

Re: External properties file


Visit bekwam.blogspot.com for Talend topics and tutorials.  Twitter @bekwaminc for updates.

Offline

#6 2011-10-12 15:43:53

pcoffre
Talend Team
Registered: 2009-03-26
Posts: 527
Website

Re: External properties file

Thanks Carl for adding this interesting post!

Best,
Pcoffre.


Follow Talend on Twitter, Linkedin, Facebook and the forum.
Download and try Talend solutions

Offline

Board footer

Powered by FluxBB