实验四触发器实验
(一)
after
触发器
(1 1 )
在l l i neitem 表上定义一个 after 触发器, , 当修改列项目e e x tendedprice d i scount
x tax 时, , 要把 s orders 表得to o tal pri ce e 一起修改, , 以保证数据一致性
C RE ATE T RIGGER
trig _line ite m_ pr ice_ update on line it em fo r upda te
a as
begin i f (UPDATE(ex tend edprice)
o r UPDATE(tax)
or UPD AT E(di scou nt)) begin
-— 声明游标变量指向 inserted 表
d eclare
cursor_inserted c urs or
rea d_only
o for select order key,linenu mber,exte nd edpr ice, dis coun t, tax
from
in ser ted
—-息...
== 试读已结束,如需继续阅读敬请充值会员 ==
|
本站文章均为原创投稿,仅供下载参考,付费用户可查看完整且有格式内容!
(费用标准:38元/月,98元/年,微信支付秒开通!) |
升级为会员即可查阅全文 。如需要查阅全文,请 免费注册 或 登录会员 |