九、mysql触发器的概念_MySQL
Release: 2016-05-31 08:46:53
Original
896 people have browsed it
-
1.所谓触发器,就是指设置好某个表的某个操作(insert ,update ,delete)时候,同时触发的一个操作; 一般用来,比如说删除文章主栏目,那么可以利用触发器删除这个文章栏目下的所有文章2.创建触发器 delimiter $$ create trigger ins_1 before insert on tt1 for each row BEGIN insert into tt2 values (now()); END; $$ 以上触发器,大概意思就是:当tt1有进行插入操作之间,即执行tt2插入操作,再执行tt1插入操作!! PS:: before insert 插入之前执行 after insert 插入之后执行 before update 更新之前执行 after update 更新之后执行3.drop trigger ins_1 删除名为 ins_1的触发器4.show triggers 查看所有触发器
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31