当前位置:网站首页>PowerDesigner技巧2 触发器模板
PowerDesigner技巧2 触发器模板
2022-06-22 09:34:00 【51CTO】
定义一个触发器模板,该模板可以被所有的表使用,如果要修改触发器时,只需要修改触发器模板即可。
[size=x-large][color=darkred]一、定义触发器模板[/color][/size]
1、添加触发器模板
[img]http://dl.iteye.com/upload/attachment/0072/8841/73d67afd-dacd-3ff0-8962-38503a587b58.png[/img]
2、现有的触发器模板列表
[img]http://dl.iteye.com/upload/attachment/0072/8843/2a2de56b-50a1-303a-ac18-227b03c223de.png[/img]
3、创建一个触发器模板:
[img]http://dl.iteye.com/upload/attachment/0072/8845/d1d26db1-86bb-3133-b6cc-d40b2b57e0a2.png[/img]
[img]http://dl.iteye.com/upload/attachment/0072/8847/77e1c0c8-f0e9-3e42-8f5b-449cd0a3f365.png[/img]
4、编写模板名称:
[img]http://dl.iteye.com/upload/attachment/0072/8849/6c3bedb4-02de-3291-9aa0-d62240dc91e5.png[/img]
5、编写触发器语句:
[img]http://dl.iteye.com/upload/attachment/0072/8851/3ed24ba1-a2ed-3abb-8e1e-72200b59c88e.png[/img]
下面给出db2、mysql的触发器语句:
db2:
CREATE TRIGGER TRG_%TABLE%_UPDATE_TIME
before
UPDATE
ON %TABLE% REFERENCING NEW AS newrow FOR EACH ROW MODE db2sql
SET
newrow.UPDATE_TIME = CURRENT TIMESTAMP
mysql:
create trigger %TRIGGER%
before
update
on %TABLE% for each row
SET NEW.UPDATE_TIME = CURRENT_TIMESTAMP
[size=x-large][color=darkred]二、用户表 通过触发器模板 添加触发器:[/color][/size]
[img]http://dl.iteye.com/upload/attachment/0072/8853/9b32970f-2949-36ac-b27e-834b812ab8e6.png[/img]
[img]http://dl.iteye.com/upload/attachment/0072/8855/a12755d2-e98a-3921-82a5-f1947b45bde0.png[/img]
[img]http://dl.iteye.com/upload/attachment/0072/8857/592a3026-be12-3a14-ad96-798fa830bbbb.png[/img]
选择Definition,并选择我们定义好的模板:
[img]http://dl.iteye.com/upload/attachment/0072/8859/7936712e-34b9-3844-8358-3f59789dab00.png[/img]
[img]http://dl.iteye.com/upload/attachment/0072/8861/b90b5da0-b36c-392b-af6d-b9b152ecedb9.png[/img]
边栏推荐
- SQL编程task06作业-秋招秘籍ABC
- mknod
- C language brush question | temperature conversion (11)
- [Luogu] P1083 [NOIP2012 提高组] 借教室(线段树)
- PAT甲级 - 1015 Reversible Primes (进制转换&素数判断)
- Philosopher‘s Walk Gym 分治+分形
- 全力以赴把防汛救灾措施落细落实落到位 坚决守护好人民群众生命财产安全
- Traifik ingress practice
- Value (address) transmission, see the name clearly, don't fall into the ditch
- [cmake命令笔记]find_path
猜你喜欢

Value (address) transmission, see the name clearly, don't fall into the ditch

File expert ---multer

钟珊珊:被爆锤后的工程师会起飞|OneFlow U

Langchao state-owned assets cloud: state-owned assets as a guide to help state-owned enterprises use data to enrich their wisdom in the cloud

Detr: end to end object detection with transformers (from Li Mu and Zhu)

秋招秘籍C

Summary and future prospect of transfer learning | community essay solicitation

一个老开源人的自述-如何干好开源这件事

day367:有效的完全平方数
![[node] node+ SMS API to realize verification code login](/img/92/acd2abf73a7b0459127dd19bf32a7c.png)
[node] node+ SMS API to realize verification code login
随机推荐
秋招秘籍A
Langchao state-owned assets cloud: state-owned assets as a guide to help state-owned enterprises use data to enrich their wisdom in the cloud
PAT甲级 - 1014 Waiting in Line (银行排队问题 | queue+模拟)
[hdu] P6964 I love counting
The difference between single bracket and double bracket in shell
Brush questions in C language | output 6 decimal places with%f control character (17)
. A use of file link library
[uni app] actual combat summary (including multi terminal packaging)
Kali uses the command ifconfig to query the solution that the IP address is always 127.0.0.1
Traifik ingress practice
Try/finally --return those things
Summary and future prospect of transfer learning | community essay solicitation
6-32 construction of linked list by header insertion method
SQLMap-hh
See how much volatile you know
全力以赴把防汛救灾措施落细落实落到位 坚决守护好人民群众生命财产安全
Ctfshow Web Learning Records
[hdu] P1466 计算直线的交点数
Common SQL statements in MySQL
SQL编程task03作业-复杂一点的查询