今天在学习mysql时,创建触发器总是不成功报这个错Not allowed to return a result set from a trigger;
比如这样创建 create trigger newproduct after insert on products for each row select 'd'; 把后面的返回结果去掉,还是报错:
ERROR 1064 (42000): 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 '' at
line 1
有谁知道原因的,帮帮忙
比如这样创建 create trigger newproduct after insert on products for each row select 'd'; 把后面的返回结果去掉,还是报错:
ERROR 1064 (42000): 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 '' at
line 1
有谁知道原因的,帮帮忙
就是这句啊
corresponds to your MySQL server version for the right syntax to use near '' at
line 1
CREATE TRIGGER newproduct AFTER INSERT ON products
FOR EACH ROW
SELECT 'd' INTO @ee;
$$
DELIMITER ;
corresponds to your MySQL server version for the right syntax to use near '' at
line 1
为啥我用//代替不行呢,非得用$$符号才行么?能给个解释么?谢谢
CREATE TRIGGER newproduct AFTER INSERT ON products
FOR EACH ROW
SELECT 'd' INTO @ee;
//
DELIMITER ;