I'm trying to create the following function in MySQL Workbench:
DELIMITER $$
CREATE FUNCTION 'capturar_consecutivo'()
RETURNS INT
BEGIN
DECLARE num INT DEFAULT 0;
SET num = ( select * from consecutivo);
RETURN num;
END
$$ DELIMITER ;
but the system throws me an error:
Error Code: 1418. This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you might want to use the less safe log_bin_trust_function_creators variable)
and the truth is that I do not understand what is due because if I run it on a localhost and the system takes it correctly, but in Workbench it does not take it. Can someone tell me if the syntax is correct?