Modifed.
DROP FUNCTION IF EXISTS PersonName; DELIMITER |; CREATE FUNCTION PersonName( personID SMALLINT ) RETURNS CHAR(20) BEGIN DECLARE pname CHAR
Best solution is, which I tried after getting the above error. The code should be like
Delimiter // Create function or procedure Write your function or procedure here... End (without semicolon) // Delimiter ; (semicolon with space)