Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Exception Handling in Native Stored Procedure

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Mariraj

New User


Joined: 09 Jul 2007
Posts: 59
Location: Chennai

PostPosted: Thu Feb 25, 2016 4:08 am    Post subject: Exception Handling in Native Stored Procedure
Reply with quote

I need to employ the following logic in a Native SP (say NSP1).

Code:
INSERT INTO TABLE1

DECLARE EXIT HANDLER FOR SQLEXCEPTION
    CONSTRUCT ERROR MESSAGE
    INSERT ERROR MESSAGE INTO TABLE2(ERROR TABLE)


If the insert into TABLE2 fails for some reason, NSP1 needs to invoke another Native SP (say NSP2) which will display the error details in the spool.

I am not sure how to accomplish this since NSP1 abruptly ends in case of a sql error within the EXIT HANDLER.

Please let me know how to accomplish this using SQL/PL.
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2108
Location: NY,USA

PostPosted: Thu Feb 25, 2016 9:51 pm    Post subject:
Reply with quote

Use
Code:
CONTINUE HANDLER
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Array in Cobol Db2 Stored Procedure Ashishpanpaliya DB2 4 Wed Jan 09, 2019 3:06 pm
No new posts Native CICS srini24 CICS 2 Thu Sep 13, 2018 2:44 am
No new posts S0C4-X'11' issue - page translation e... ashek15 JCL & VSAM 8 Wed Aug 15, 2018 4:23 am
No new posts SQL Code 302 while executing stored ... Ashishpanpaliya DB2 8 Wed Aug 01, 2018 7:54 pm
No new posts sql code 331 while calling Stored Pro... Ashishpanpaliya DB2 5 Wed Aug 01, 2018 7:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us