My DB2 version is version 9.1 (Fix Pack 6 , 64 bits)。
When using GET DIAGNOSTICS EXCEPTION，I have a problem with garbled message。
My code is :
CREATE PROCEDURE SP_EXCP_B(OUT p_MSG VARCHAR(1000))
DECLARE EXIT HANDLER FOR SQLEXCEPTION
GET DIAGNOSTICS EXCEPTION 1 p_MSG = MESSAGE_TEXT;
INSERT INTO TEST(F_ID) VALUES(INTEGER('ABC'));
After calling the procedure, I found that the content of p_MSG is garbled message like
"SQL0420N b "INTEGER" rALrC SQLSTATE=22018 "
How could I solve the problem ? Thanks.
Pinned topic garbled message, when using GET DIAGNOSTICS EXCEPTION
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-01-29T21:19:32Z at 2013-01-29T21:19:32Z by nivanov1
nivanov1 100000H9H7231 Posts
Re: garbled message, when using GET DIAGNOSTICS EXCEPTION2013-01-29T21:19:32ZThis is the accepted answer. This is the accepted answer.May be set the DB2CODEPAGE variable on the client to value of the database code set? Or enable the appropriate national character support in your client?