I've been looking through the Redbook on stored procedures and triggers trying to find information on error trapping. I've found the information on trapping for specific errors:
but what if I'm not interested in the specifics? All I want to do is if there was a problem with the query write a message in the job log (QSYSOPR messages) that the SP failed to run properly so that it can be run again.
Here's the procedure:
Thanks for any info!
Leslie
Code:
DECLARE record_not_found
CONDITION for '02000';
but what if I'm not interested in the specifics? All I want to do is if there was a problem with the query write a message in the job log (QSYSOPR messages) that the SP failed to run properly so that it can be run again.
Here's the procedure:
Code:
CREATE PROCEDURE QGPL.SP_TAHEARINGS (
IN I_HEARINGDATE DECIMAL(8, 0) )
LANGUAGE SQL
SPECIFIC QGPL.SP_TAHEARINGS
NOT DETERMINISTIC
MODIFIES SQL DATA
CALLED ON NULL INPUT
BEGIN
DELETE FROM CMLIB . CMPTAHEARINGS ;
DELETE FROM CMLIB . CMPTASENTNC ;
INSERT INTO CMLIB . CMPTAHEARINGS ( CASPRE , CASNUM , HERTIM, DEFNAM )( SELECT DISTINCT H.CASPRE , H.CASNUM , H.HERTIM, DEFNAM FROM CMLIB.CMPHERMF H INNER JOIN CMLIB.CMPDEFMF D ON H.CASPRE = D.CASPRE AND H.CASNUM = D.CASNUM WHERE H.HERNGDAT = I_HEARINGDATE AND H.HERTYP = 'TA' ) ;
END ;
Thanks for any info!
Leslie