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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tMysqlRow - how to capture sql error

Hi!
I am using tMysqlRow component and when there is an error in SQL, the return code of the component is 0. This is problematic since I have subsequent jobs that have a dependency on the success of this job.
To replicate, in a tMysqlRow component, write a simple insert sql with syntax error. Run the job. In the console, the error is shown but the exit code is 0.
Thanks,
Sarah
Labels (2)
5 Replies
Anonymous
Not applicable
Author

Hello
There is a 'die on error' option on the component, uncheck this option. The job will capture the exception and continue to process the next subJobs.
If there is a syntax error in the sql, the job can't run as there are some compilation error in generated code. You should correct the compilation error first.
Best regards
shong
Anonymous
Not applicable
Author

Thanks shong. Sure, syntax error should be fixed. but a more realistic error is at runtime, such as unique constraint / integrity contraint that can only be known at runtime. But based on your suggestion, 'die on error' will not stop the entire job in this particular case, it will only capture the exception. So does that mean that it won't have an exit code of 1? thanks!
Anonymous
Not applicable
Author

Hello
'die on error' will not stop the entire job in this particular case, it will only capture the exception. So does that mean that it won't have an exit code of 1? thanks!

yes, there is not exception message printted on console and the job works fine, the exit code will be 0.
Best regards
shong
Anonymous
Not applicable
Author

Shong, I misunderstood your statement. I do want the job to fail if there is any error thrown in that component during runtime. so I should check 'die on error'.
thanks.
Anonymous
Not applicable
Author

Hello
I do want the job to fail if there is any error thrown in that component during runtime. so I should check 'die on error'.

Yes. 0683p000009MACn.png
Best regards
shong