/**
 * Author:  TI6
 * Created: 12/02/2016
 */
SET TERM ^ ;

CREATE OR ALTER TRIGGER TTBORCAMENTO_B0I_01 FOR TBORCAMENTO
ACTIVE BEFORE INSERT POSITION 0
AS
begin
      if(new.ID is null) then
        new.ID = gen_id(GTBORCAMENTO, 1);

      new.DATAHORA = 'now';
end^

SET TERM ; ^

