You are not logged in.
i have a list of file names that need to be created and populated from a DB.
the source table is like this:
create table tb_fileListed(
filename varchar( 200 ),
at first i need to check if a file already exsts, and if not then create one.
my requirement is to place all files into a defined folder, this is defined as a variable in my job <baseFolder>.
i have created a mysql input to retrieve the dataset from the db, and connected to a tFolwToIterate.
and i thought that i would be able to connect to a tFileExists and then tFileTouch but i can not work out how to set the value for the file path since they only accept variables.
i suppose i can not see how to send the values from the row into a variable for each value.
i am sure this is something simple that i am missing out.
the examples are for java:
You can retrieve the actual row (of tFlowToIterate) with the following syntax (in this example the connection to tFlowToIterate is named row1):
To handle the folder you should define a context variable and create the filename as follows:
globalMap.get("row1.filename") + "/" + context.folder
i have created this job to understand your explanation.
but i can not receive any value for globalMap.get("row1.filename").
please have a look at the screenshot to see what i am missing.
i am trying to get the correct result in a message box at this point.
Volker it worked just fine.
i did have a minor glitch, as i had to cast it as a string:
just so i do not need to disturb you with these simple question.
where do you find information about this type of classes of Talend? globalMap ??
i did check the documentation and could not find it anywhere.
yes you have to use toString() or cast the result. The hash is based on Object (i think).
To get more information about this you should read the code (as I have done).
There is no specific documentation about this (as I know).
just for reference
it can be done in a different way:
tMap (manipulate rows)
tJavaRow( set a variable with the value of a row [context.CURRENT_FILE = input_row.filename;]