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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

spliting files an renaming files

Hi,
I'm new on Talend.
I'm trying to create a file for each row I have in my database and want to rename each file whith a unique variable I have in the row.
My input file is a mysql database, I use a tmap before spliting in multiples files using xmloutput composant.
I try to put a variable in the "+("row1.id")+".xml", I have a null1, null2, null3 ....
Thanks for help
Sorry for my english
Labels (4)
20 Replies
Anonymous
Not applicable
Author

Your code looks correct. What could be happening is that some rows of your input are not joining to the main flow-- leaving the value in the global map for that row as NULL. When you attempt to call .toString() on that null value, you will get a null pointer exception. If you expect some rows to not have lookup values, you can protect your call in the tJavaFlex by checking if the value is null before calling toString() on it:
globalMap.get("row11.AGEDEB") == null ? "" : row10.AGEDEB=globalMap.get("row11.AGEDEB").toString();