CREATE PROCEDURE `spAddLink` ( IN `P_TeacherId` INTEGER , IN `P_ContentPath` VARCHARACTER (?) , IN `P_ContentLink` VARCHARACTER (?) , IN `P_ContentTitle` VARCHARACTER (?) ) BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN ROLLBACK ; SELECT ? ; END ; START TRANSACTION ; INSERT INTO `tteacherContent` ( `TeacherId` , `ContentLink` , `ContentPath` , `ContentTitle` , `CreatedDateTime` ) VALUES ( `P_TeacherId` , `P_ContentLink` , `P_ContentPath` , `P_ContentTitle` , NOW ( ) ) ; SELECT `LAST_INSERT_ID` ( ) ; COMMIT ; END 