Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I'm Using a tFileList and a tFileInputPositional to read files from some subfolders and Insert the data in a sql table.
I would like to insert also in the sql table a new column with the folder name (given by the tFileList).
How can I do that?
I leave you with a print of my job:
Thanks,
Miguel Cunha
@shongthank you for your help.
I did what you say but the output was null for all columns.
Am I doing something wrong?
@sgvStill not working.
Now all columns ourtuput is ok, except the variable one.
Is the variable ok? ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
It's depend of the name of your variable.
So your tFileList have a Talend Name and a Personnal name (default : personnal name = talend name).
for exemple :
Here, personnal name is "azerty" and TalendName is "tFileUnarchive_1"
So what is the purpose of that :
When you want to use a global variable, you have just to write this : "azerty." and then if you press "Ctr+space", talend will give you every global var generated by the component.
like this :
Then, you have juste to choise the global var needed, and Talend will give you the appropriate code. In this case, I want the CURRENT_FILEPATH : ((String)globalMap.get("tFileUnarchive_1_CURRENT_FILEPATH"))
It's really important to understand that if you want to use global var from component.
In your case, maybe you can rename your tFileList with a name variable more appropriate, like ListeFile
And then in your tMap try to write "ListeFile." and press "Ctr+Space"
Good luck
SGV
@sgvThank you very much. I already made it but your answer made me understand a little more about those variables.