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
Hello, Thanks very much for your help ! It works now ! I have all my files with the right name but XML fields are now empty except for the EAN. Do I have to set global var for each field ? Where ?
I try to set all vars in the tjavaflex ! It works for row11 row10.SERIEL=globalMap.get("row11.SERIEL").toString(); WORK row10.ISBN=globalMap.get("row11.ISBN").toString(); WORK row10.EAN=globalMap.get("row11.EAN").toString(); WORK row10.AGEDEB=globalMap.get("row9.cum_age").toString(); DOESN'T WORK Any help please ?
the tFlowToIterate is what is putting the row values into the global map. row9 is not being processed by the flowToIterate-- so its values will not be put into the global map. looking at your screenshots, all you would need to do is include the "cum_age" column in your row11 output table in the tMap, then you will be able to pull it out of the global map like all the other row11 values.
I put the row9.cum_age in row11.AGEDEB in the TMAP but when I do a row10.AGEDEB =globalMap.get("row11.AGEDEB ").toString(); in the tjava flex it doesn't work error Exception in component tJavaFlex_1 java.lang.NullPointerException at webedition.test_0_1.test.tMysqlInput_2Process(test.java:3428) at webedition.test_0_1.test.runJobInTOS(test.java:5371) at webedition.test_0_1.test.main(test.java:5243)
are you still refering to it with this? row10.EAN=globalMap.get("row9.cum_age").toString(); if so, change it to: row10.EAN=globalMap.get("row11.AGEDB").toString();
I made an error sorry it's not row10.EAN=globalMap.get("row9.cum_age").toString(); but row10.AGEDB=globalMap.get("row9.cum_age").toString(); I tried both, they don't work. row10.AGEDB=globalMap.get("row11.AGEDB").toString(); row10.AGEDB=globalMap.get("row9.cum_age").toString();
Now I manage to get the row11.ean name for filename and i can set globalvar for every row11 that came from the row6 but
it doesn't work for those which came from row8 or row9 so I can fill my xml file with all fields.
The line row10.AGEDEB=globalMap.get("row11.AGEDEB").toString(); in the tjavaflex doesn't work
Maybe I have to make a join in the tjavaflex but how ?