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.
search cancel

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

Bind Analyzer for DB2 for z/OS SQL-Ease for DB2 for z/OS SYSVIEW Performance Management Option for DB2 for z/OS Plan Analyzer for DB2 for z/OS 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