I have tried to use the export option in phpMyAdmin routines panel to copy functions from one database to another, with no success.
The export option supplies me with the following:
CREATE DEFINER=`root`@`localhost` FUNCTION `JSON_FIELD_NUM`(`col_name` TEXT CHARSET utf8, `data` TEXT CHARSET utf8) RETURNS text CHARSET utf8
NO SQL
BEGIN
RETURN
CONCAT('"',col_name,'":',
IF(ISNULL(data),0,data)
);
END
I get this error when I run that in another database:
#1064 - 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 7
I tried adding DELIMITER $$ at the top and $$ after END, but still no joy.