hi,
i am new for writting sp.
Here is my sp..
In java program when i call this sp then how to take care for exception for each delete statement. Is there any thing like multiple result set..pl. give me some sample code for this type of sp calling in java program.
Thanks in Advanced.
i am new for writting sp.
Here is my sp..
Code:
CREATE PROCEDURE DB2ADMIN.DELETE_FEE_ENTRY (IN accountNbr integer, In fltNbr smallint, IN fltExpMM smallint, IN fltExpCCYY smallint,IN suppNbr smallint, OUT OUT_SQLCODE int)
------------------------------------------------------------------------
-- SQL Stored Procedure
------------------------------------------------------------------------
P1: BEGIN
DECLARE v_app_msg VARCHAR(200) DEFAULT '';
DECLARE v_db2_msg VARCHAR(200) DEFAULT '';
DECLARE v_error SMALLINT DEFAULT 0;
-- Error Handling
DECLARE CONTINUE HANDLER FOR NOT FOUND
BEGIN NOT ATOMIC
SET v_error = 1;
END;
DECLARE CONTINUE HANDLER FOR SQLWARNING
BEGIN NOT ATOMIC
SET v_error = 2;
END;
DELETE FROM DB2ADMIN.MCS_IR_VEH_FEE WHERE
CARRIER_AC_NBR = accountNbr AND
FL_NBR = fltNbr AND
FL_EXP_CCYY = fltExpCCYY AND
FL_EXP_MM = fltExpMM AND
SUP_NBR = suppNbr;
DELETE FROM DB2ADMIN.MCS_IR_VEH_SUP_FEE WHERE
CARRIER_AC_NBR = accountNbr AND
FL_NBR = fltNbr AND
FL_EXP_CCYY = fltExpCCYY AND
FL_EXP_MM = fltExpMM AND
SUP_NBR = suppNbr;
DELETE FROM DB2ADMIN.MCS_IR_SUP_FEE WHERE
CARRIER_AC_NBR = accountNbr AND
FL_NBR = fltNbr AND
FL_EXP_CCYY = fltExpCCYY AND
FL_EXP_MM = fltExpMM AND
SUP_NBR = suppNbr;
DELETE FROM DB2ADMIN.MCS_IR_JUR_FEE WHERE
CARRIER_AC_NBR = accountNbr AND
FL_NBR = fltNbr AND
FL_EXP_CCYY = fltExpCCYY AND
FL_EXP_MM = fltExpMM AND
SUP_NBR = suppNbr;
SET OUT_SQLCODE = v_error;
END P1
Thanks in Advanced.