jeudi 21 juillet 2016

creating trigger mysql #1064

when i m trying to execute this query to create TRIGGER with Mysql

CREATE TRIGGER `befor_insert_VIN` BEFORE INSERT ON `vin_table`
FOR EACH ROW 
BEGIN
IF( SELECT COUNT(*) FROM `vin_table` WHERE `MODEL_CODE`= NEW.MODEL_CODE AND
`LOT`= NEW.LOT AND `VIN`= NEW.VIN >0 ) THEN BEGIN
DELETE FROM `vin_table` WHERE `LOT`= NEW.`LOT`;
END ;
END IF;
END ;

i received this response

MySQL a répondu:

1064 - Erreur de syntaxe près de '' à la ligne 5

Aucun commentaire:

Enregistrer un commentaire