I am trying to create a stored function.
>From the docs I saw the code for this function:
CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50)
DETERMINISTIC
    RETURN CONCAT('Hello, ',s,'!');

The version from the docs did not contain the DETERMINISTIC keyword.
I added because it would not compile.

The problem is that if I change the code to:
CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50)
DETERMINISTIC
LANGUAGE SQL
BEGIN
    RETURN CONCAT('Hello, ',s,'!');
END;
I get the error message:
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 'END' 
at line 1

Can someone shed some light about the syntax of functions?
The docs didn't help much.

Thanks for your help.
-- 
Three words describe our society:homo homini lupus


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to