Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to move files from a local directory to an SFTP server using the tFTPPut component.
Since there are many files (and they are coming from various locations) I am using variables to specify the local directory, the remote directory, filemask and new name as shown below.
This results in a "file name invalid!" error message being displayed when executing the job for a single file.
However when I provide literal values (taken from the variables) then the job runs correctly and places the file on the SFTP server location such as the setup below.
Please let me know if there is something wrong with my setup & is it possible to use the variables to specify the local directory, filemask & new name?
Thanks
Hi,
Are you sure the row3 fields are all populated?
If yes, I suggest you to use global variables instead of row field.
You can use tFlowToIterate before to genrate the required variables.
Also, can you share a screenshot for the complete job design?
Hi,
Are you sure the row3 fields are all populated?
If yes, I suggest you to use global variables instead of row field.
You can use tFlowToIterate before to genrate the required variables.
Also, can you share a screenshot for the complete job design?
I believe this is probably because of the same reason you cannot select a file to write to from a flow. This is an irritating "feature" of Talend, but easy to get round. Instead of using your row variables, connect the component before teh ftp component to a tFlowToIterate component. This will put all of the columns into a globalMap HashMap. You can access the variables as below.....
globalMap.get("row.column")
"row" and "column" correspond to your row name (feeding into the component) and column name.
If you connect your tFlowToIterate component to your FTP component using an Interate link, then you can use the variables stored in the globalMap.
If you are familiar with Java you will know you will need to cast these variables. If you are not, basically you will need to change the class type they refer to. To simplify this just think about the Column Type in the schema. If it says String you will need to use the following code....
((String)globalMap.get("row.column))
Seems I essentially put what @TRF put. Sorry mate, I left this open ready to comment and then got sidetracked with some fo my actual work. Ended up filling it in later and then saw yours 🙂
@zsiddiqi very strange!!!
Can you share your job design?
I think that is a lucky timing quirk @TRF. While the tFlowToIterate is processing the following iterating, the row variables used may still hold valid values. But the globalMap values should be used to be safe in my opinion.