这是我的代码:
CREATE TRIGGER `back_up_data` BEFORE UPDATE ON `admin`
FOR EACH ROW BEGIN
DECLARE x FLOAT;
IF NEW.sem_completed=1 THEN
SET x=update_cgpa();
TRUNCATE notifications;
TRUNCATE course_offerings;
TRUNCATE takes;
SET NEW.sem_completed=0;
UPDATE students SET current_sem=(current_sem+1);
IF OLD.current_semester=0 THEN
SET NEW.current_year=OLD.current_year+1;
SET NEW.current_semester=1;
ELSE
SET NEW.current_semester=0;
END IF;
END IF;
END
当我尝试运行此代码时,我收到以下错误: 无法从其他存储例程中创建存储过程