MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DB2 Trigger - Error Handling

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
gopurs
Beginner


Joined: 30 Jun 2009
Posts: 8
Topics: 3

PostPosted: Fri Feb 02, 2018 10:05 am    Post subject: DB2 Trigger - Error Handling Reply with quote

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
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Feb 02, 2018 10:18 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Feb 02, 2018 12:21 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group