Why wasn't the SQL Error from my Native Stored Procedure displayed on the SQL ERROR Summary Display? I used the EXIT HANDLER FOR SQLEXCEPTION clause in my SP.

book

Article ID: 39086

calendar_today

Updated On:

Products

CA Bind Analyzer for DB2 for z/OS CA Detector CA SQL-Ease for DB2 for z/OS CA Sysview Performance Management Option for DB2 for z/OS CA Database Detector for DB2 for z/OS CA Plan Analyzer for DB2 for z/OS CA Subsystem Analyzer for DB2 for z/OS

Issue/Introduction

Introduction: 

This document explains why an SQL Error from a Native Stored Procedure may not be displayed when the EXIT HANDLER FOR SQLEXCEPTION clause is used.

Question: 

Why wasn't the SQL Error from my Native Stored Procedure displayed on the SQL ERROR Summary Display? I used the EXIT HANDLER FOR SQLEXCEPTION clause in my SP.

Environment:  

z/OS 1.11 and above.

Answer: 

When DECLARE EXIT HANDLER FOR SQLEXCEPTION is used, the handler gets control when an SQL error occurs and clears the error code. Afterwards, when Detector regains control at the end of the SQL process, there is no SQL error to be reported.

Environment

Release:
Component: PDT