CREATE PROCEDURE `spDeleteNoticeBoard` ( IN `P_NoticeId` INTEGER ) BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN SELECT ? ; END ; IF NOT EXISTS ( SELECT ? FROM `tnoticeboard` WHERE `id` = `P_NoticeId` ) THEN SELECT ? ; ELSE START TRANSACTION ; DELETE FROM `tnoticeboard` WHERE `Id` = `P_NoticeId` ; SELECT ? ; COMMIT ; END IF ; END 