While creating a new alert type in Web Console generated from a SQL only script, the result is always "Execution Status code: 2" even though the script returns only other very different values: 0, -1 and -2.
The script was adapted from the Information Center (http://www-01.ibm.com/support/knowledgecenter/SS62YD_4.1.0/com.ibm.datatools.db.web.health.install.doc/topics/customalerts_sample_scripts.html) and follows below:
SELECT CASE level
WHEN 'W' THEN -1
WHEN 'E' THEN -2
WHEN 'C' THEN -2
WHEN 'S' THEN -2
END AS RETURNVALUE
FROM TABLE (PD_GET_DIAG_HIST('MAIN','ALL', '', CURRENT TIMESTAMP - 1 DAYS, CURRENT TIMESTAMP)) AS T;
I verified that the script was created in the Alert Types page as a "SQL only script".
Is really the script execution engine returning the correct return code? If so, why it does not return the codes it should as the Information Center says, and what can be done so the script returns only the desired values?
Thank you in advance.