Link to home
Start Free TrialLog in
Avatar of Prardhan N
Prardhan NFlag for India

asked on

How to Print SQLCODE and SQLSTATE info in the Procedure output in DB2 LUW 10.5

Hi All

Please let me know "How to Print SQLCODE and SQLSTATE info in the Procedure output when procedure fails
to process some input records.

So that i can understand the problem of issue.

Thanks in advance!!!
ASKER CERTIFIED SOLUTION
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Prardhan N

ASKER

Thanks for response..

I got the clue that i need to create a error table.
I have declared the SQLCODE and SQLSTATE variables.

i have added following to my code.
DECLARE EXIT HANDLER FOR SQLEXCEPTION
    SET SQLSTATEOUT = SQLSTATE;

DO i need to add the insert into error_code table in with in handler block?
How to move the control to "insert into error_code table" statement.

Pls let me know
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Question abandoned
Provided solution