CREATE FUNCTION myFunction()
RETURNS int(11)
BEGIN
RETURN 1;
END;
There is a problem with the above code because it doesn't use any DELIMITER statements at all. I found this solution on http://forums.mysql.com/read.php?98,212863,212877#msg-212877
Well, I have tested that again on phpMyAdmin, but it still doesn't work. I found some people said don't use phpMyAdmin to run this type of statement. Hence, I tried MySQL Query Browser, it works well.
DELIMITER $$
CREATE FUNCTION myFunction() RETURNS int(11)
BEGIN
RETURN 1;
END $$
DELIMITER ;
Have a look on full syntax of create stored routine.
No comments:
Post a Comment