TIS Use tnsnames definition in runtime

One Star

TIS Use tnsnames definition in runtime

Hello
I'm creating a talend job for my company. This job will execute oracle sql scripts and generate custom outputs.
It will be called from command line, the name of the database will be an arguement in this command line.
There's a big number of databases in my company and this number and db definitions can change...
The solution that we considered is that the name of the database will be the same of tnsnames.ora file..
The problem is that I cannot find a way to connect to database in talend using tnsnames in runtime.. I can do it in design time (use TNS file...).
Could you please tell me if there's a workaround or a custom component that will do it?
Thanks
One Star NSG
One Star

Re: TIS Use tnsnames definition in runtime

Hello
I'm creating a talend job for my company. This job will execute oracle sql scripts and generate custom outputs.
It will be called from command line, the name of the database will be an arguement in this command line.
There's a big number of databases in my company and this number and db definitions can change...
The solution that we considered is that the name of the database will be the same of tnsnames.ora file..
The problem is that I cannot find a way to connect to database in talend using tnsnames in runtime.. I can do it in design time (use TNS file...).
Could you please tell me if there's a workaround or a custom component that will do it?
Thanks
One Star

Re: TIS Use tnsnames definition in runtime

Hi,
any update to this? I would also like to use tnsnames at runtime, just to specify path to my tnsnames.ora file, SID, username and password. All of these as context parameters. Is that possible?
Thanks,
Tomas
Four Stars

Re: TIS Use tnsnames definition in runtime

You may have already thought about this - but what if you designed the job to use the database name (which is same as the tnsnames.ora) to read the file, parse it for the elements and load them into context variables?
One Star

Re: TIS Use tnsnames definition in runtime

Thanks willm for your answer.
Yes, I know I could read the file and parse it for the details, I was just hoping there is some easier solution to this. tOracleConnection component obviously can parse tns files (at design time), so I thought it would be somehow possible to use it for parsing tns files at runtime. Probably not. I will end up with parsing it by my own.
Community Manager

Re: TIS Use tnsnames definition in runtime

Thanks willm for your answer.
Yes, I know I could read the file and parse it for the details, I was just hoping there is some easier solution to this. tOracleConnection component obviously can parse tns files (at design time), so I thought it would be somehow possible to use it for parsing tns files at runtime. Probably not. I will end up with parsing it by my own.

Hi
It don't parse automatically the details from the tns file at runtime, because the tns file may contain multiple services. At design time, it requires user to click the 'Select a DB conenction in TNS File' button and select the service.
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business