DELIMITER

This MySQL statement changes the delimiter (terminating character) of SQL statements from the default of a semi-colon to another character.

Syntax

Below is the syntax for this command. Text within square brackets (i.e, [ and ] ) are optional. Choices are separated by bars (i.e, | ). Ellipses preceded by a comma indicates a repeating pattern. Ellipses before or after syntax are used to highlight a relevant except from the larger syntax. Text displayed in italic letters represent text that should be replaced with the specific names related to the database (e.g., column with the name of the column).

DELIMITER character

Explanation

This statement changes the delimiter (terminating character) of SQL statements from the default of a semi-colon to another character. This is useful when creating a stored procedure or trigger, so that MySQL does not confuse a semi-colon contained in the procedure or trigger as the end of the CREATE PROCEDURE or CREATE TRIGGER statement. This statement is also used to restore the default delimiter. Don't use the back-slash as the delimiter, as that is used to escape special characters. Examples of this statement appear in the CREATE PROCEDURE and CREATE TRIGGER statements.