Can't create base stored process on MariaDB

The documented procedure in the MariaDB page fails for me:

https://mariadb.com/kb/en/mariadb/documentation/sql-commands/data-definition/create/create-procedure/

DELIMITER //

CREATE PROCEDURE simpleproc (OUT param1 INT)
 BEGIN
  SELECT COUNT(*) INTO param1 FROM t;
 END;
//

      

I am getting this error:

The following errors were reported: You have an error in your SQL syntax; check the manual corresponding to your MySQL server version for the correct syntax to use next to "DELIMITER // CREATE PROCEDURE simpleproc (OUT param1 INT) BEGIN SELECT COUNT" on line 1 You have an error in your SQL syntax; check the manual corresponding to your MySQL server version for the correct syntax to use next to "END" on line 1 You have an error in your SQL syntax; check the manual corresponding to your MySQL server version for the correct syntax to use next to "//" on line 1

What am I doing wrong and how do I fix it?

+3


source to share


1 answer


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 ;

      

+1


source







All Articles