CREATE PROCEDURE `spAddSubcategory` ( IN `P_CategoryId` INTEGER , IN `P_Code` VARCHARACTER (?) , IN `P_Title` VARCHARACTER (?) ) BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION ROLLBACK ; SELECT ? ; START TRANSACTION ; INSERT INTO `tSubCategoryMaster` ( `CategoryId` , CODE , `Title` ) VALUES ( `P_CategoryId` , `P_Code` , `P_Title` ) ; SELECT `LAST_INSERT_ID` ( ) ; COMMIT ; END 