CREATE PROCEDURE `spDeleteOnlinelecture` ( IN `P_LectureId` INTEGER ) BEGIN IF EXISTS ( SELECT ? FROM `tonlinelecture` WHERE `Id` = `P_LectureId` ) THEN DELETE FROM `tonlinelecture` WHERE `Id` = `P_LectureId` ; ELSE SELECT ? ; END IF ; END 