Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Unable to use context variable in tSCPList

Hi,
I'm trying to pick out specific files from a Unix directory using tSCPList and tSCPGet components
I'm able to get the required file if the name is typed in explicity
eg: "find /opt/net/tmfrge/var/filestore/ -name '*witi298c782b8196b9dea1e09a8b'"
However, for my requiremnt, the filename will be dynamic - sourced from a database.
The code is:
tMySQLinput ->tFlowToIterate ->tJava ->tSCPFileList ->tSCPGet
In the tJava, the required filename is being set to a context variable so that it can be used in the command as below:
"find /opt/net/tmfrge/var/filestore/ -name  'context.raw_file_id'"
where:
context.raw_file_id="*"+((String)globalMap.get("row3.rawfileid"));
An example of context.raw_file_id printed in the tJava is *witi298c782b8196b9dea1e09a8b
When the context variable is given in the command, the the job executes but does not get any file.I've tried using '+context.raw_file_id+','$context.raw_file_id' but none of them seem to work.
Am I missing something in the syntax of the context variable or is this not supported? I'm using Talend Open studio for Big Data(6.0.0.20150702_1326)
Please help.
Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi All,
Figured out a syntax error:
it should be :"find /opt/net/tmfrge/var/filestore/ -name "+context.raw_file_id+""
This will let the value from the context variable to be read.
It is resolved.
Thanks.

View solution in original post

1 Reply
Anonymous
Not applicable
Author

Hi All,
Figured out a syntax error:
it should be :"find /opt/net/tmfrge/var/filestore/ -name "+context.raw_file_id+""
This will let the value from the context variable to be read.
It is resolved.
Thanks.