Cannot create function or procedure Print

  • 59

If you are getting a syntax error when trying to create a function or procedure, something like this:

ERROR 1064 (42000): 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 'return c' at line 1

You can try to define the delimiter first, as indicated in the MySQL manual:

mysql> delimiter //
mysql> CREATE PROCEDURE simpleproc (OUT param1 INT)
->   SELECT COUNT(*) INTO param1 FROM t;
-> END//
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter ;

Was this answer helpful?

« Back