0
I’m trying to create a Rigger using phpmyadmin with Mariadb bank but when it gets on the line if it gives a message:
unrecognized statement type. (near IF)
Trigger is the one:
SET @TOTAL = (SELECT COUNT(*) FROM cliente C WHERE C.NR_CPF = NEW.NR_CPF);
IF @TOTAL > 0 THEN BEGIN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'An error occurred'
END IF;
when it arrives in the word IF gives the message
unrecognized statement type. (near IF)
– adventistaam