这是我的密码:
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
当我尝试运行这段代码时,我得到了以下错误:无法从另一个存储例程中创建存储过程
暂无答案!
目前还没有任何答案,快来回答吧!