My code:
DELIMITER //
CREATE FUNCTION f_desc (in_preco int)
RETURNS INT
BEGIN
DECLARE fim_preco INT;
IF in_preco >= 100 THEN
-- aqui
fim_preco := format(10 * in_preco/100, 2);
ELSEIF in_preco >= 200 THEN
-- aqui
fim_preco := format(20 * in_preco/100, 2);
ELSE
-- aqui
fim_preco := in_preco;
END IF;
RETURN(fim_preco);
END;
//
Where I checked it turns red and displays:
syntax error unexpected end_preco
I really do not understand why, since the variable was created ..