Is there a way to determine the current delimiter in MySQL?
The delimiter can be set like this: DELIMITER //
Or like this: \d //
But how do you get the current delimiter?
I tried browsing the results of SHOW STATUS
and SHOW VARIABLES
to no avail.
By default, mysql itself recognizes the semicolon as a statement delimiter, so you must redefine the delimiter temporarily to cause mysql to pass the entire stored program definition to the server. To redefine the mysql delimiter, use the delimiter command.
In computer programming, a delimiter is a character that identifies the beginning or the end of a character string (a contiguous sequence of characters). The delimiting character is not part of the character string.
In MySQL query, what does the $$ signify? DELIMITER $$ CREATE TRIGGER before_population_update BEFORE UPDATE ON City FOR EACH ROW BEGIN INSERT INTO City_Changes SET ACTION = 'update', CityID = OLD.ID, Population = OLD.
Delimiters can be used when you need to define the stored procedures, function as well as to create triggers. The default delimiter is semicolon. You can change the delimiters to create procedures and so on.
If you just want to know which delimiter is set right now \s
will show you that:
Using delimiter: //
The delimiter is not a keyword or command on the server (it's not even a reserved keyword), so there is absolutely no way to get it back from the server (since the server doesn't know about it)
It's used by the client (and the client must support it), and only by the client.
If you try to send a DELIMITER //
from a client that doesn't support it, you'll get a syntax error
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With