Din syntaks ser ud til at være MySQL. Og alligevel, raise_application_error
er en Oracle-konstruktion. Du vil have signal
, dokumenteret her
:
DELIMITER @@
DROP TRIGGER IF EXISTS gmtt.after_update_mcorr @@
CREATE TRIGGER gmtt.after_update_mcorr
AFTER UPDATE ON gmtt.mcorr
FOR EACH ROW
BEGIN
IF OLD.etat = '0' AND NEW.etat = '1' THEN
INSERT INTO historique(message, User, dateHisto)
VALUES (CONCAT( 'a achevé la Maintenance ', OLD.codeMaint) , CURRENT_USER(), NOW());
ELSE
signal sqlstate '-20000' set message_text = 'Pay is below Texas minimum wage!';
END IF;
END @@
DELIMITER ;