日期:2014-05-17  浏览次数:20853 次

oracle 触发器 把更新的提高20% 但不高于100
create or replace trigger zyw_score_tigao
before update of tea_avg_score on zyw_score
for each row
begin
if (:new.tea_avg_score*1.2)<100
then
update zyw_score set tea_avg_score=:new.tea_avg_score*1.2;
else
update zyw_score set tea_avg_score=80;
end if;
end;

这样写有什么错误??

--创建的表
create table ZYW_SCORE
(
  course_id VARCHAR2(8),
  tea_avg_score NUMBER(8),
  tea_course VARCHAR2(8),
  tea_id VARCHAR2(8)
)



------解决方案--------------------
对自身表做触发 你还做update
对:new赋值就可以