1
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 marked it turns red and presents:
syntax error Unexpected fim_preco
I really don’t understand why, since the variable was created..