2024-11-03 08:37:25
(1)
create or replace trigger befInsEI_t
before insert on EvalIndex for each row
declare v_EIWeight float;
begin
select sum(EIWeight)+:new.EIWeight into v_EIWeight
from EvalIndex where EIID=:new.EIID;
if v_EIWeight>1 then
RAISE_APPLICATION_ERROR(-20001,'总权重超过1');
else
DBMS_OUTPUT.put_line('总权重为:'||v_EIWeight);
end if;
end;
(2)
create or replace trigger aftInsERes_t
after insert on EvalResult for each row
begin
delete from EvalRecord where EREvalued=:new.EResEvalued;
end;
(3)
create or replace trigger insevalStu_v instead of
insert on evalStu_v for each row
insert into Student(sname,sphone)
values (:new.sname,:new.sphone);
end;