Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i have an API job (Talend Studio 7.3.1) which try to insert data into a table (postgreSQL). There is a FK between this table and an other one. when a line can't be inserted because of the FK how can i trap this event to use it in the API response ? if i plug a tlogrow after my tDBOutput's "onComponentError" he NEVER go in...
but into the execution log i see an "[ERROR] ********tDBOutput******viole la contrainte de clé étrangère « fk_******_ »
thanks for your ideas !
regards,
Sylvain
Hello,
If you would like to catch sql exception in your flow, please try this approach and let me know if it helps:
Check the "Die on error" option.
As all the error message has been included in the SQLException, you do not need to call getNextException() again.
Just handling the current SQLException is enough.
And log4j is also flexible, you could just add more appender in log4j to redirect the error log to the target you want.
Here is also a topic about How to get Call getNextException in talend.
Hope it helps for your use case.
Best regards
Sabrina
Hello Team,
Could you please check this link :
https://community.talend.com/s/question/0D53p00007vCsXgCAK/foreign-key-same-table-error?language=en_US
https://community.talend.com/s/question/0D53p00007vCnXCCA0/can-talend-handle-foreign-key-dependencies?language=en_US
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 🙂
Hello,
If you would like to catch sql exception in your flow, please try this approach and let me know if it helps:
Check the "Die on error" option.
As all the error message has been included in the SQLException, you do not need to call getNextException() again.
Just handling the current SQLException is enough.
And log4j is also flexible, you could just add more appender in log4j to redirect the error log to the target you want.
Here is also a topic about How to get Call getNextException in talend.
Hope it helps for your use case.
Best regards
Sabrina