Question

What does DELIMITER // do in a Trigger?

DELIMITER //

What is the of use of it?

 45  91106  45
1 Jan 1970

Solution

 88

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.

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

2009-08-28

Solution

 36

In SQL you close each statement with a delimiter, which is by default a semicolon (;). In a trigger you need to write multiple statements, each ending in a semicolon. To tell MySQL that those semicolons are not the end of your trigger statement, you temporarily change the delimiter from ; to //, so MySQL will know that the trigger statement only ends when it econunters a //.

2009-08-28