我收到错误“触发器无效且重新验证失败”,因为我写的是从表中删除学生的过程。
程序dropstudent
(v_sid in students.sid%type,
v_classid in classes.classid%type,
status1 out varchar,
status2 out varchar,
status3 out varchar) is
c_sid students.sid%type;
c_classid enrollments.classid%type;
cnt number;
v_size classes.class_size%type;
begin
chk_sid_classid(v_sid,v_classid);
select sid,classid into c_sid,c_classid
from enrollments
where sid = v_sid and classid = v_classid;
select count(sid) into cnt
from enrollments
where sid = v_sid
group by sid;
if(cnt = 1) then
status1:='This student is not enrolled in any classes.';
else
status1:=' ';
end if;
select class_size into v_size
from classes
where classid = v_classid;
if (v_size = 1) then
status2:='The class now has no students.';
else
status2:=' ';
end if;
delete from enrollments where sid = v_sid and classid = v_classid;
exception
when no_data_found then
status3 := 'The student is not enrolled in the class';
端;
我在
收到错误delete from enrollments where sid = v_sid and classid = v_classid;
as Trigger无效且重新验证失败。
谁能告诉我究竟是什么错?