Home > Database > Mysql Tutorial > mysql-关于Mysql设置触发器以后不能插入的问题

mysql-关于Mysql设置触发器以后不能插入的问题

WBOY
Release: 2016-06-06 09:45:12
Original
1698 people have browsed it

mysql触发器

我在Mysql中设置了一个触发器,在用户还没有修改用户名的情况下将uid作为默认的用户名:

enter code here
///触发器没法自己修改自己的表。。。

DELIMITER |

CREATE TRIGGER default_name AFTER INSERT ON user
FOR EACH ROW BEGIN
update user set NEW.user_name= NEW.uid;

END
|
然后插入了一条数据,发现出现了以下错误:
can't update 什么的、、
CSDN移动问答

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template