CREATE GENERATOR GTBREQUISICAO_OC;

CREATE OR ALTER trigger TTBREQUISICAO_OC_B0I for TBREQUISICAO_OC
active before insert position 0
AS
begin
	if(new.ID is null) then
		new.ID = gen_id(GTBREQUISICAO_OC, 1);
end;


-----------------------------
-----------------------------


CREATE GENERATOR GTBREQUISICAO_OC_ITEM;

CREATE OR ALTER trigger TTBREQUISICAO_OC_ITEM_B0I for TBREQUISICAO_OC_ITEM
active before insert position 0
AS
begin
    if(new.ID is null) then
        new.ID = gen_id(GTBREQUISICAO_OC_ITEM, 1);
end;


-----------------------------
-----------------------------


CREATE GENERATOR GTBORCAMENTO;

CREATE OR ALTER trigger TTBORCAMENTO_B0I for TBORCAMENTO
active before insert position 0
AS
begin
      if(new.ID is null) then
        new.ID = gen_id(GTBORCAMENTO, 1);
end;


-----------------------------
-----------------------------


CREATE GENERATOR GTBORCAMENTO_ITEM;

CREATE OR ALTER trigger TTBORCAMENTO_ITEM_B0I for TBORCAMENTO_ITEM
active before insert position 0
AS
begin
    if(new.ID is null) then
        new.ID = gen_id(GTBORCAMENTO_ITEM, 1);
end;


-----------------------------
-----------------------------


CREATE GENERATOR GTBLICITACAO;

CREATE OR ALTER trigger TTBLICITACAO_B0I for TBLICITACAO
active before insert position 0
AS
begin
      if(new.ID is null) then
        new.ID = gen_id(GTBLICITACAO, 1);
end;