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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How can I print useful error log file?

Hi,
I have one main input and tow output tables. To keep the transaction complete, I set if table 2 failed, then table 1 needs to be rollbacked. Please see the attached picture.
The rollback data is OK but I wonder how can I print out the message why table 2 has error? for example, log supposes to tell me which row and which column is failed because it is NULL or type incorrect or FK constraint.
How to do the print useful log files?
Thanks,
Vincent
0683p000009MCeV.jpg 0683p000009MC9d.jpg
Labels (2)
5 Replies
Anonymous
Not applicable
Author

Hello
Use the tLogCatcher to catch the error message, please see the user documentation and leran its usage.
Best regards
shong
Anonymous
Not applicable
Author

Hi, Shong:
If you can look at the first picture, I want to print out the failed message before rollback. For example, I want to know which row id is failed.
Thank you,
Anonymous
Not applicable
Author

Connect that rejects flow to a delimited text file and you can capture the error messages generated by your database.
The rejects flow (at least on my DB2 components) adds two extra fields/columns to the end of the flow that show error information.
Here's an example of one of my jobs (see attached).
Output for the last two columns looks like this in my case:
||DB2 SQL error: SQLCODE: -117, SQLSTATE: 42802, SQLERRMC: null
0683p000009MClU.jpg
Anonymous
Not applicable
Author

Thank you, SMaz.
Also my case is parent/child tables, so if child table failed, then rollback parent table. My child delimitedfile should print out the error message. To make this work, I need to set customer buffer size to 1 for flush the result.
I attached the picture to explain it. If there is another way, please correct me.
Another question for SMaz, why do you add tDie component? I am curious.
0683p000009MCSJ.jpg
Anonymous
Not applicable
Author

I use tDie to abort the execution of the job and to allow me to specify an error code which becomes the "return value" passed to the script file that called my Talend job. By setting a different error code for each of my tDie components, I can tell where the job has failed.
This is useful in a production environment - once you have deployed your jobs to a server and you are not running them interactively through TOS.