I boiled this down to a a few statements:
CREATE FUNCTION Hierarchy_Agent(value INT)
RETURNS INT
NOT DETERMINISTIC READS SQL DATA
BEGIN
DECLARE xid INT;
END
result:
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 '' at line 5

line 5 is the declare statement... I think.
What gives? Every source I check verifies correct syntax.
I'm originally SQL Server... only recently beginning with mySQL.
version is '5.1.66-0+squeeze1'

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.