Salve a tutti,
ho creato questo trigger
________________
CREATE TRIGGER contabilita_ticket BEFORE UPDATE ON contabilita_ticket
FOR EACH ROW
BEGIN
IF NEW.data_pagamento IS NOT NULL THEN
INSERT INTO contabilita_ticket_comprati (codice_ticket,nome_ticket_shop,prezzo,id_utente_r ichiedente,data_richiesta,data_pagamento)
VALUES (OLD.codice_ticket,OLD.nome_ticket_shop,OLD.prezzo ,OLD.id_utente_richiedente,OLD.data_richiesta,NEW. data_pagamento);
END IF;
END;
____________
Il problema è che non funziona. Qualcuno saprebbe trovare l'errore??
L'errore che mi viene riportato è il seguente:
_______
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 6
Questo è l'errore.
________
Grazie in anticipo