SET TERM ^ ;

CREATE OR ALTER trigger ttbmeta_b0i for tbmeta
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(GTBMETA,1);

--  NEW.DATA_INICIO = '01.'||NEW.MES||'.'||NEW.ANO;
--  NEW.DATA_FIM = CAST('01.'||EXTRACT(month FROM NEW.DATA_INICIO+31)||'.'||EXTRACT(YEAR FROM NEW.DATA_INICIO+31) AS DATE)-1;

end
^

SET TERM ; ^

