Warning
SingleStore 9.0 gives you the opportunity to preview, evaluate, and provide feedback on new and upcoming features prior to their general availability. In the interim, SingleStore 8.9 is recommended for production workloads, which can later be upgraded to SingleStore 9.0.
MySQL Client Delimiters
On this page
Redefines the MySQL delimiter.
Syntax
DELIMITER delimiter_symbol
Remarks
When creating a function or a procedure using a MySQL-compatible client connected to SingleStore, you must change the client delimiter to ensure that the function or procedure definition is correctly passed to the server as a single statement.
The DELIMITER
commands must be on independent lines.
To change the MySQL delimiter, execute the following command before creating a new function or procedure:
DELIMITER //
When you’ve finished defining functions or procedures, make sure to change the MySQL delimiter back to a semicolon:
DELIMITER ;
Example
The function below uses the delimiter //
, which can be executed directly in a MySQL-compatible client connected to SingleStore:
DELIMITER //CREATE FUNCTION plus_one(a INT) RETURNS INT ASDECLAREb INT = a;BEGINb += 1;RETURN b;END //DELIMITER ;
All SingleStore Procedural SQL (PSQL) topics include this MySQL delimiter consideration.
Last modified: November 27, 2024