CREATE OR ALTER TRIGGER TTBCLIENTE_BIUD_API FOR TBCLIENTE
ACTIVE BEFORE INSERT OR UPDATE OR DELETE POSITION 999
AS
BEGIN
    IF(INSERTING)THEN EXECUTE PROCEDURE SPI_INTEGRACAO_API('TBCLIENTE',NEW.CODIGO,'I');
    IF(UPDATING )THEN EXECUTE PROCEDURE SPI_INTEGRACAO_API('TBCLIENTE',NEW.CODIGO,'A');
    IF(DELETING )THEN EXECUTE PROCEDURE SPI_INTEGRACAO_API('TBCLIENTE',OLD.CODIGO,'D');
END;

CREATE OR ALTER TRIGGER TTBREPRESENTANTE_BIUD_API FOR TBREPRESENTANTE
ACTIVE BEFORE INSERT OR UPDATE OR DELETE POSITION 999
AS
BEGIN
    IF(INSERTING)THEN EXECUTE PROCEDURE SPI_INTEGRACAO_API('TBREPRESENTANTE',NEW.CODIGO,'I');
    IF(UPDATING )THEN EXECUTE PROCEDURE SPI_INTEGRACAO_API('TBREPRESENTANTE',NEW.CODIGO,'A');
    IF(DELETING )THEN EXECUTE PROCEDURE SPI_INTEGRACAO_API('TBREPRESENTANTE',OLD.CODIGO,'D');
END;