【发布时间】:2015-07-14 02:02:54
【问题描述】:
我正在尝试在将记录插入主表时将新记录插入表中。但是它甚至没有注册为触发器......
DELIMITER $$
CREATE TRIGGER trigger_InsertRoleplay ON `users`
FOR INSERT AS
BEGIN
INSERT INTO
`roleplay_users`
(
id
)
SELECT
id
FROM
INSERTED
END$$
DELIMITER ;
返回的错误。
CREATE TRIGGER trigger_InsertRoleplay ON `users`
FOR INSERT AS
BEGIN
INSERT INTO
`roleplay_users`
(
id
)
SELECT
id
FROM
INSERTED
END;
/* SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON `users`
FOR INSERT AS
BEGIN
INSERT INTO
`roleplay_users`
' at line 1 */
/* Affected rows: 0 Found rows: 0 Warnings: 0 Duration for 0 of 1 query: 0.000 sec. */
【问题讨论】: