将值传递到此存储过程的正确方法是什么,显然我的做法不正确,在一个过程中执行两个语句是否安全,或者我应该创建两个单独的语句?
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `drop_student`(IN section_id VARCHAR(20), IN student_id VARCHAR(20))
BEGIN
SET @section_id=section_id;
SET @student_id=student_id;
PREPARE STMT2 FROM
"DELETE FROM transcript
WHERE STUDENT_ID = @student_id
AND SECTION_ID = @section_id ";
PREPARE STMT FROM
"DELETE FROM course
WHERE STUDENT_ID = @student_id
AND SECTION_ID = @section_id ";
EXECUTE STMT2 USING @section_id,@student_id;
EXECUTE STMT USING @section_id,@student_id;
END