View previous topic :: View next topic |
Author |
Message |
gopurs Beginner
Joined: 30 Jun 2009 Posts: 8 Topics: 3
|
Posted: Fri Feb 02, 2018 10:05 am Post subject: DB2 Trigger - Error Handling |
|
|
Can I do error handling in DB2 Trigger. I haven't seen much information online or in the redbook regarding error handling in DB2 Triggers. DB2 normally returns -723 error when the triggered statement encounters any error. Is it possible to capture that and then send out the actual error which is normally stored in the SQLCA. Can I use SIGNAL statement to do that. My application always shows the -723 error when the trigger fails and then someone has to research it to identify the actual cause or the actual SQL itself. So any help is highly appreciated.
So is there any way I can capture the -723 error and return the actual SQLCODE associated with that -723 back to the application program without making changes to the application program to read the SQLCA for a -723 error and then translating the details from SQLERRMC back to the screen. My front end is CICS.
Trigger Details
I have an AFTER INSERT trigger which actual copies the same data and inserts into the same table by changing couple of fields. We are actually doing a data replication for another line of business using the trigger.
DB2 Trigger is running in Mainframe running Z/OS
Thanks,
Gopu |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Feb 02, 2018 10:18 am Post subject: |
|
|
I would delete this - it was posted yesterday on another forum and on that same forum it was posted again - in the same topic. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Fri Feb 02, 2018 12:21 pm Post subject: |
|
|
gopurs,
Please do not post the same question across different forums. Now coming to the question look up the
SIGNAL SQLSTATE keyword and add it to your trigger definition. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|