展开全部
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | CREATE trigger malice on BBSUser for update as if update (receive) --当receive字段发生update事件时触发 begin update bbsuser set receive_temp=bu.receive_temp+(i.receive-d.receive) from bbsuser bu,deleted d,inserted i where bu.userid=i.userid declare @ temp float ,@scope float set @ temp =( select bb.receive_temp from bbsuser bb,deleted d where bb.userid=d.userid) set @scope=( select bb.receive_scope from BBSUser bb,deleted d where bb.userid=d.userid) if @ temp <=@scope update userinfo set standnumber=bu.standnumber+(i.receive-d.receive) from userinfo bu,deleted d,inserted i where bu.userid=d.userid declare @ user int ,@com float select @ user =d.userid,@com=us.standnumber from UserInfo us,Deleted d,Inserted i where us.userid=d.userid exec timely @ user ,@com if @ temp >@scope begin update userinfo set standnumber=bu.standnumber+(@scope-d.receive) from userinfo bu,deleted d,inserted i where bu.userid=d.userid update bbsuser set receive_temp=@scope from bbsuser bu,deleted d where bu.userid=d.userid select @ user =d.userid,@com=us.standnumber from UserInfo us,Deleted d,Inserted i where us.userid=d.userid exec timely @ user ,@com end end |
光点科技
2023-08-15 广告
2023-08-15 广告
通常情况下,我们会按照结构模型把系统产生的数据分为三种类型:结构化数据、半结构化数据和非结构化数据。结构化数据,即行数据,是存储在数据库里,可以用二维表结构来逻辑表达实现的数据。最常见的就是数字数据和文本数据,它们可以某种标准格式存在于文件...
点击进入详情页
本回答由光点科技提供
推荐于2018-03-09
展开全部
直接调用
CREATE OR REPLACE TRIGGER TRU_WORKSAL
AFTER UPDATE OR DELETE
ON WORKSAL
FOR EACH ROW
DECLARE CALC DATE;
BEGIN
pad_amt(:new.salmonth,:new.staff);
pad_sal(:new.salmonth,:new.staff);
END;
/
CREATE OR REPLACE TRIGGER TRU_WORKSAL
AFTER UPDATE OR DELETE
ON WORKSAL
FOR EACH ROW
DECLARE CALC DATE;
BEGIN
pad_amt(:new.salmonth,:new.staff);
pad_sal(:new.salmonth,:new.staff);
END;
/
本回答被提问者和网友采纳
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询