create trigger mysql
why this is not work??



Wrong and in UPDATE section, comma needed; 
The trigger contains single statement, so BEGIN-END block is excess.

CREATE TRIGGER prosesqc2
AFTER INSERT ON quality2
FOR EACH ROW 
INSERT INTO stock_barang 
    SET  idbarang     = NEW.idbarang, 
         lolos_qc_sfl = NEW.terima, 
         dalam_proses = NEW.terima
ON DUPLICATE KEY 
UPDATE lolos_qc_sfl = lolos_qc_sfl + NEW.terima, 
       dalam_proses = dalam_proses - NEW.terima;