MySQL CREATE FUNCTION Syntax

Ich bin versucht, zu erstellen eine Funktion in MySQL:

Hier ist der SQL-code:

CREATE FUNCTION F_Dist3D (x1 decimal, y1 decimal) 
RETURNS decimal
DETERMINISTIC
BEGIN 
 DECLARE dist decimal;
 SET dist = SQRT(x1 - y1);
 RETURN dist;
END;

Ich erhalte die folgende Fehlermeldung:

#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 10

Ich bin mit diesem create-Anweisung in phpMyAdmin. Was ist Los mit dieser Funktion?

InformationsquelleAutor der Frage Mel | 2011-07-19

Schreibe einen Kommentar