The fact is that I am making a trigger to act as a mirror in another table, however it is not working as it should. Here I leave the trigger:
CREATE TRIGGER new_loaner_added
AFTER INSERT ON 'total_loaner' for each row
begin
INSERT INTO NuevaVisita (not_cliente, not_fecha, not_act, ofi, not_fecha_proxima, not_tipo, not_estado, not_motivo, not_usuarioactu, not_horainicio, not_horafin, not_despacho) VALUES (NEW.idpaciente, CURDATE(), '1', '1', '2017-09-12', '1', '1', 'ALGO', 'NADIE', '09:00', '10:00', '1')
END;
The issue is that the NEW.idpaciente is not recovering and I get a value of 0. With the other fields of the trigger the same thing happens to me whenever I use NEW.field.
I will continue insisting to see if I can find the solution, in the meantime I would appreciate any information that the community can provide me.