samedi 24 juillet 2021

Error #1064 - You have an error in your SQL syntax; during make trigger with if statement mysql

i need some help in this sql code i have 2 condition

CREATE TRIGGER Aging_TTF30
BEFORE INSERT ON abc
FOR EACH ROW

IF NEW.jumlah IS NULL OR NEW.jumlah <= 0 THEN
SET NEW.selisih = 'retur';
ELSE
SET NEW.selisih = DATE(NEW.Tgl_Inv) - DATE(NEW.Tgl_TF)

END IF

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 6

Aucun commentaire:

Enregistrer un commentaire