SQL_ERROR_MESSAGE shows error message for most of the cases but its NULL for the error code : 1299 - no data found
DROP PROCEDURE TEST_EXCEPTION;
CREATE PROCEDURE TEST_EXCEPTION ()
LANGUAGE SQLSCRIPT
AS
BEGIN
DECLARE VAR_TEMP VARCHAR(10);
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
SELECT ::SQL_ERROR_CODE,::SQL_ERROR_MESSAGE FROM DUMMY;
END;
--INSERT INTO "TEJA"."USERS" VALUES ('U_USER1','UNION'); --shows the error message (primary key violation)
--SELECT 1/0 FROM DUMMY; --shows the error message
SELECT VALUELESS INTO VAR_TEMP FROM "TEJA"."TEMP10" WHERE VALUELESS = 'DIVI';
END;