我写了一个简单的触发器,但它引发了我没有得到的错误。继承人我的触发器:
CREATE TRIGGER logSlette After DELETE on ansatte
for each row
begin
insert into slettede_ansatte set AnsattID=old.AnsattID,slettet=now()
end;
表的create table语句是:
CREATE TABLE slettede_Ansatte
(
AnsattID Integer(4) NOT NULL,
slettet TIME NOT NULL,
CONSTRAINT Ansatte_PK Primary Key(AnsattID)
) ENGINE=INNODB;
答案 0 :(得分:0)
(修订版)
CREATE TRIGGER logSlette AFTER DELETE ON ansatte
FOR EACH ROW
BEGIN
INSERT INTO slettede_ansatte
SET AnsattID = OLD.AnsattID,
slettet=now();
END;
也许是缺少分号?