Topic
1 reply Latest Post - ‏2013-01-29T21:19:32Z by nivanov1
iamnovice
iamnovice
5 Posts
ACCEPTED ANSWER

Pinned topic garbled message, when using GET DIAGNOSTICS EXCEPTION

‏2013-01-23T06:38:22Z |
Hi
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))
LANGUAGE SQL
SPECIFIC EXCP_B
BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION
GET DIAGNOSTICS EXCEPTION 1 p_MSG = MESSAGE_TEXT;
INSERT INTO TEST(F_ID) VALUES(INTEGER('ABC'));
END

After calling the procedure, I found that the content of p_MSG is garbled message like
"SQL0420N b "INTEGER" rALrC SQLSTATE=22018 "

How could I solve the problem ? Thanks.
Updated on 2013-01-29T21:19:32Z at 2013-01-29T21:19:32Z by nivanov1
  • nivanov1
    nivanov1
    231 Posts
    ACCEPTED ANSWER

    Re: garbled message, when using GET DIAGNOSTICS EXCEPTION

    ‏2013-01-29T21:19:32Z  in response to iamnovice
    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?