0

我有当前的触发器:

CREATE TRIGGER ChangeAutoIncrementMeasures ON Measures 
 FOR EACH ROW BEFORE INSERT
 BEGIN 
  SET @@auto_increment_increment = 100
 END;

但我得到 1064 错误。我的错误在哪里?

编辑:应该是:

CREATE TRIGGER ChangeAutoIncrementVendors BEFORE INSERT ON Vendors 
FOR EACH ROW 
    SET @@auto_increment_increment = 10
4

2 回答 2

0

在您的 SET 语句之后需要一个分号,并且 BEFORE INSERT 移动....

delimiter //

CREATE TRIGGER ChangeAutoIncrementMeasures BEFORE INSERT ON Measures 
FOR EACH ROW 
BEGIN 
  SET @@auto_increment_increment = 100;
END;
//

delimiter;
于 2013-07-22T09:53:25.387 回答
0

更改语法如下

CREATE TRIGGER ChangeAutoIncrementMeasures

BEFORE INSERT ON Measures 

FOR EACH ROW
 BEGIN
  SET @@auto_increment = 100;
 END
于 2013-07-22T09:55:06.427 回答