CREATE OR ALTER trigger TTBLICITACAO_B0D_01 for TBLICITACAO
active before delete position 0
AS
begin
  DELETE FROM TBORCAMENTO WHERE LICITACAO_ID = OLD.ID;
  UPDATE TBREQUISICAO_OC_ITEM set LICITACAO_ID = null, FLAG = 1 WHERE LICITACAO_ID = old.ID;
end;


--
--


CREATE OR ALTER trigger TTBORCAMENTO_B0D_01 for TBORCAMENTO
active before delete position 0
AS
begin
  DELETE FROM TBORCAMENTO_ITEM WHERE ORCAMENTO_ID = OLD.ID;
end;