Hi
There is a problem with SQLyog whereby functions with a routine_body can not be created.
Example:
CREATE FUNCTION hello (s CHAR(20))
RETURNS CHAR(50)
RETURN CONCAT('Hello, ',s,'!')
The above works fine but if you enclose any statements in a routine body, an error occurs.
CREATE FUNCTION hello (s CHAR(20))
RETURNS CHAR(50)
BEGIN
RETURN CONCAT('Hello, ',s,'!')
END;
…gives: Error Code : 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 'RETURN CONCAT('Hello, ',s,'!')
END' at line 4
(0 ms taken)
Any ideas please?