tSystem parameters - how to use in command?

One Star

tSystem parameters - how to use in command?

Hi!

I am using a tSystem component on a Windows XP system. I have added 2 parameters "server" and "sql_script". I need to pass the values to the command that is being run by the component. I have tried several things with no success. I am hoping some one here can give me the proper syntax.

Here is an example of what I want to do in the command:

"sqlplus -s /nolog @" + <parameter1 from the component> + " " + <parameter2 from the component

I have posted a screen shot showing the component configuration.

I am sure it is something simple but I have not been able to figure it out. I have tried this in 3.0.4, 3.1.0M3 and 3.1.0RC1.

Here is the code that is being generated:

envMapClone_tSystem_1.put("sql_script", "c:/temp.d/sp2.sql");
envMapClone_tSystem_1.put("server", "prdaix002");
env_tSystem_1 = new String[envMapClone_tSystem_1.size()];
int i_tSystem_1 = 0;
for (String envKey : (java.util.Set<String>) envMapClone_tSystem_1
.keySet()) {
env_tSystem_1[i_tSystem_1++] = envKey + "="
+ envMapClone_tSystem_1.get(envKey);
}
final Process ps_tSystem_1 = runtime_tSystem_1.exec(
"sqlplus -s /nolog @"
+ ((String) context.getProperty("sql_script"))
+ " " + ((String) context.getProperty("server")),
env_tSystem_1);

Both what is in code in the screen shot and the code using env_tSystem_1 did not work and returned "NULL" for both values.

Thanks in advance for your time, help and patience!

Dave Venus
One Star

Re: tSystem parameters - how to use in command?

Bump! Anyone that can help with this?
Community Manager

Re: tSystem parameters - how to use in command?

Hello

Define the parameters in context tab, that is don't add them on tSystem component and use the context variable like this:
"sqlplus -s /nolog @" + context.sql_script+ " " + context.server

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

2019 GARTNER 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

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog