0

I'm trying to run a simple code that had already run on another machine and worked perfectly, now that I try to run it on my machine I get the syntax error.

I run it in Workbench Version 8.0

delimiter $$
create function funcion_mul(P_NUM2 INT)
returns INT
begin
    DECLARE declare valor_final INT default 0;
    RETURN valor_final;
END;
$$
delimiter ;

"DECLARE" is no valid at this position for this server version, expecting :

¿Qué es lo que está mal?

Thanks

1
  • 2
    You have a typo: DECLARE declare Commented Aug 19, 2019 at 23:59

1 Answer 1

1

What about removing the declare duplication ?

delimiter $$
CREATE FUNCTION funcion_mul(P_NUM2 INT)
RETURNS INT
BEGIN
    DECLARE valor_final INT default 0;
    RETURN valor_final;
END;
$$
delimiter;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.