DELIMITER//在触发器中做什么?

2021-11-20 00:00:00 sql mysql
DELIMITER //

它有什么用?

推荐答案

它将语句分隔符从 ; 更改为 //.这样您就可以在触发器定义中编写 ; ,而不会被 MySQL 客户端误解为意味着您已经完成了.

It changes the statement delimiter from ; to //. This is so you can write ; in your trigger definition without the MySQL client misinterpreting that as meaning you're done with it.

请注意,当改回来时,它是 DELIMITER ;,而不是 DELIMITER;,因为我见过人们尝试这样做.

Note that when changing back, it's DELIMITER ;, not DELIMITER; as I've seen people try to do.

相关文章