Home > Database > Mysql Tutorial > mysql触发器实例

mysql触发器实例

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:19:51
Original
1129 people have browsed it

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;//

Related labels:
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 Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template