开发者

MySql Triggers - Can a trigger stop ALL dml?

开发者 https://www.devze.com 2022-12-13 09:39 出处:网络
Is it possible to create a trigger on a table that is initiated when ANY dml is performed on the table?

Is it possible to create a trigger on a table that is initiated when ANY dml is performed on the table?

For example -- I need to ensure that no insert/update/delete statements can be run on the weekend. So, instead of writing:

CREATE TRIGGER开发者_如何学运维 DENY_DML_1 BEFORE INSERT...

CREATE TRIGGER DENY_DML_2 BEFORE UPDATE...

CREATE TRIGGER DENY_DML_3 BEFORE DELETE...

...is it possible to write one trigger to rule them all?

Many thanks in advance! ~Daniel


No. From the documentation:

trigger_event indicates the kind of statement that activates the trigger. The trigger_event can be one of the following: INSERT... UPDATE... DELETE...

0

精彩评论

暂无评论...
验证码 换一张
取 消