触 发器 before 的写法如下
2015-10-13 16:44
246 查看
hen using row level triggers (and BEFORE triggers are always row level triggers), you do not use UPDATE statements to modify the contents of the according row but use SET statements to modify the individual columns of the current row - cf. that sample from
the docs:
So in your case it might work to use something like (I don't claim to understand the calculations):
the docs:
CREATE TRIGGER emp_upper_postal_code BEFORE UPDATE OF PostalCode ON Employees REFERENCING NEW AS new_emp FOR EACH ROW WHEN ( ISNUMERIC( new_emp.PostalCode ) = 0 ) BEGIN -- Ensure postal code is uppercase (employee might be -- in Canada where postal codes contain letters) SET new_emp.PostalCode = UPPER(new_emp.PostalCode) END;
So in your case it might work to use something like (I don't claim to understand the calculations):
... set new_shipper_line.amount = isnull(new_shipper_line.user_9,0) * isnull(new_shipper_line.user_10,0); set new_shipper_line.sys_all_amt = isnull(new_shipper_line.user_9,0) * ...
相关文章推荐
- [原创]PostgreSQL中十进制、二进制、十六进制之间的相互转换
- [iOS]应用内切换语言,本地化,国际化
- Android自定义View和自定义属性
- 将WORD文件转换成HTML文件的路径问题
- Scala教程(十二)List操作高级进阶实战
- 文章标题
- 推荐一个 angular 图像加载插件
- jquery获取文档高度和窗口高度问题
- mvn打包发布
- js闭包
- ASP学习笔记
- hdu3673 David Shopping 堆
- 【LeetCode从零单刷】Nim Game
- UVA-227
- IOS多线程
- Object-C 关键字之property,assign,copy,retain,release
- 【转】中断处理函数中不用disable_irq而用disable_irq_nosync原因
- hdu3673 David Shopping 堆
- XMPP协议简介
- JQuery 学习总结及实例