It works when I run (in SQLyog 5.02)
Code:
DELIMITER $$;
DROP FUNCTION IF EXISTS `bSemi`$$
CREATE FUNCTION `bSemi`(a FLOAT, e FLOAT) RETURNS FLOAT
BEGIN
/* a is semimajor axis, in AU
e is eccentricity,
b is semiminor axis, in AU
b = a * (1 – e^2)
*/
DECLARE b FLOAT;
SET b = a * SQRT(1 – e*e);
RETURN ROUND(b, 7);
END$$
DELIMITER;$$
it doesn't work when I add a header string to describe the function
Code:
/* = FUNCTION bSemi ============================================================== */
DELIMITER $$;
DROP FUNCTION IF EXISTS `bSemi`$$
CREATE FUNCTION `bSemi`(a FLOAT, e FLOAT) RETURNS FLOAT
BEGIN
/* a is semimajor axis, in AU
e is eccentricity,
b is semiminor axis, in AU
b = a * (1 – e^2)
*/
DECLARE b FLOAT;
SET b = a * SQRT(1 – e*e);
RETURN ROUND(b, 7);
END$$
DELIMITER;$$
I've tried all the comment delimiters I know of, /* */, #, //, –, to comment out the header line, with same result …
Are comment headers disallowed in functions?
see — http://forums.mysql.com/read.php?98,123079,123108#msg-123108