CREATE trigger ttbtipo_visita_b01iud for tbtipo_visita
active before insert or update or delete position 999
AS
begin

  if(inserting)then execute procedure spi_integracao_mobile('TBTIPO_VISITA',new.id,'I');
  if(updating )then execute procedure spi_integracao_mobile('TBTIPO_VISITA',new.id,'A');
  if(deleting )then execute procedure spi_integracao_mobile('TBTIPO_VISITA',old.id,'D');

end;

CREATE trigger ttbregistro_visita_b01iud for tbregistro_visita
active before insert or update or delete position 999
AS
begin
  if(inserting)then execute procedure spi_integracao_mobile('TBVISITA',new.id,'I');
  if(updating )then execute procedure spi_integracao_mobile('TBVISITA',new.id,'A');
  if(deleting )then execute procedure spi_integracao_mobile('TBVISITA',old.id,'D');
end;


