Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple delete statment in db2 stored procedure - java

Status
Not open for further replies.

ketandba

Programmer
Nov 15, 2004
38
US
hi,
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
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.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top