ALTER TABLE TBNF_DEVOLUCAO
ADD USUARIO_ID INTEGER;

ALTER TABLE TBNF_DEVOLUCAO
ADD DATAHORA TIMESTAMP
DEFAULT 'NOW';

CREATE TRIGGER TTBNF_DEVOLUCAO_BI0 FOR TBNF_DEVOLUCAO
ACTIVE BEFORE INSERT POSITION 0
AS
begin
   IF(NEW.USUARIO_ID IS NULL)THEN
   BEGIN
      NEW.USUARIO_ID = FN_CURRENT_USER_ID();
   END
end;