Reputation: 12423
The documented stored procedure on the MariaDB page fails to execute for me:
DELIMITER //
CREATE PROCEDURE simpleproc (OUT param1 INT)
BEGIN
SELECT COUNT(*) INTO param1 FROM t;
END;
//
I get this error:
The following errors were reported: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER // CREATE PROCEDURE simpleproc (OUT param1 INT) BEGIN SELECT COUNT' at line 1 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END' at line 1 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '//' at line 1
What am I doing wrong and how can I fix it?
Upvotes: 4
Views: 4479
Reputation: 1588
Adds the following statement to the end of the script: DELIMITER ;
DELIMITER //
CREATE PROCEDURE simpleproc (OUT param1 INT) BEGIN
SELECT COUNT(*) INTO param1 FROM t;
END;
//
DELIMITER ;
Upvotes: 8