CREATE OR ALTER trigger ttbapi_b01d for tbapi
active before delete position 0
AS
BEGIN
   IF(OLD.ID > 0) THEN
   BEGIN
      DELETE FROM TBAPI_FAMILIA      WHERE API_ID = OLD.ID;
      DELETE FROM TBAPI_USUARIO      WHERE API_ID = OLD.ID;
      DELETE FROM TBAPI_TABELA_PRECO WHERE API_ID = OLD.ID;
   END
END;
