Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have what seems to be an easy job that is not working.
I just want to insert 3 columns from a tas400 input into an idb2 table.
One column I would like to bring in the file name from the previous tfilelist component using a built in Talend expression.
I've tried several times to modify the red underlined area that is being flagged in the Code tab, but with no success.
I attached snapshots.
And also, I do have a context defined as a File Location path of the file I would like to get the name of at time of processing.
Anyone know how to resolve my error?
Thank you!
Michelle
Hi Michelle,
I think we overlooked the String closure for Insert statements. A simple example for String insert is as shown below.
So in your case, you need to add single quotes for your full file path within single quotes. Please add opening single quote as
values ('"+context.filelocation (before double quotes)
and closing single quotes as CURRENT_FILE"))+"', current_timestamp (after double quotes)
I believe it should do the magic. Could you please try and let me know?
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
MMiller,
At the outset i see that you are enclosing context variables in quotes, try removing those quotes around context variables, allowing the system to infer those values rather than considering them as constants.
Let me know how it goes.
Hi Michelle,
I would recommend some minor changes in your current job flow.
1) The first suggestion will be to use On SubJob Ok instead of On Component Ok.
You can refer the difference between two in below link.
https://help.talend.com/reader/t8PcR8IoDGOfid5OjAngXQ/q1xPuU8rV3IK6WG6~AkREg
2) You need to realign the syntax of your query. You cannot change the code in code view. You can use the code view to identify the area of error. Then go back to designer mode and make necessary amendments. Since Talend is code generator, the code will automatically get changed once you make changes in Designer mode.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
Now, the last tip like in Avenger End credits 😉
Please use the Photo icon as shown below to upload your images inline in your post. It will generate more interest among Talend users as many of them are reluctant to open the attachments.
Thanks for the reply, but unfortunately this did not remove the error.
Thank you Nikhilthampi!
I will try your suggestions.
And thank you also for the link for the difference between subjob and component's ok!
In addition, I will use the photos function for postings.
Ok here is where I am at with the changes......and I am getting a new error which are attached.
Token G?
Hi Michelle,
I think we overlooked the String closure for Insert statements. A simple example for String insert is as shown below.
So in your case, you need to add single quotes for your full file path within single quotes. Please add opening single quote as
values ('"+context.filelocation (before double quotes)
and closing single quotes as CURRENT_FILE"))+"', current_timestamp (after double quotes)
I believe it should do the magic. Could you please try and let me know?
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
You rock!
Yes, this did it....it is now writing to the table as expected.
Thank you so much @nthampi!
Will mark as Solution and give kudos!