当前位置:Gxlcms > mysql > mysql触发器实例

mysql触发器实例

时间:2021-07-01 10:21:17 帮助过:40人阅读

DELIMITER // DROP TRIGGER IF EXISTS t_after_insert_test// CREATE TRIGGER t_after_insert_test AFTER INSERT ON test FOR EACH ROW BEGIN IF new.type='1' THEN insert into test_hisy(name, type, create_time, operation) values(new.name, new.type,

DELIMITER //

DROP TRIGGER IF EXISTS t_after_insert_test//

CREATE TRIGGER t_after_insert_test

AFTER INSERT ON test

FOR EACH ROW

BEGIN

IF new.type='1' THEN

insert into test_hisy(name, type, create_time, operation)

values(new.name, new.type, new.create_time, 'insert');

END IF;

END;//

人气教程排行