1
What’s wrong with create Function? I’m not finding out. Already of the error in the first line.
CREATE FUNCTION SEQ_NEXT_VAL()
RETURNS INT
DETERMINISTIC
BEGIN
DECLARE retorno INT;
SELECT MAX(IDE_ERROR) INTO retorno FROM ERROR_LOGGING;
IF retorno = NULL THEN
retorno = 1;
ELSE
retorno = retorno + 1;
END IF;
RETURN retorno;
END;
And what was the error reported? You will have to [Edit] the question with the details in order to help.
– UzumakiArtanis
ERROR 1064(42000): you have an error in SQL syntax near '' at line 5
– BicaBicudo
lack the
delimiter
, do so:delimiter $$
and at the end of the functionend $$
– Don't Panic
@Everson is not that the problem just lacked the SET of variables.
– arllondias
Note that in this other question - https://stackoverflow.com/q/6740932, the error is the same commented this, and this missing delimite, what was said in the answer accepted.
– UzumakiArtanis
Note that in this question, in the question is already with the SET of variables, so DELIMITER is really missing, but as I said, depending on some editors they do it automatically
– arllondias