mysql触发器,当增加新的学生信息时,能够自动列出该同学的全部信息,以下代码该如何改,求高手指点 60
createtriggerdisplay_triggerafterinsertonstudentforeachrowbegindeclarev_snamevarchar(...
create trigger display_trigger after insert on student for each row
begin
declare v_sname varchar(8);
declare v_ssex varchar(2);
declare v_sbirthday date;
declare v_classno varchar(6);
select sname,ssex,sbirthday,classno into v_sname,v_ssex,v_sbirthday,v_classno from student
where sno=new.sno;
end; 展开
begin
declare v_sname varchar(8);
declare v_ssex varchar(2);
declare v_sbirthday date;
declare v_classno varchar(6);
select sname,ssex,sbirthday,classno into v_sname,v_ssex,v_sbirthday,v_classno from student
where sno=new.sno;
end; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询