CREATE TABLE TBMDF_LOGS (
    ID INTEGER NOT NULL,
    MDF_ID INTEGER NOT NULL,
    "LOG" BLOB SUB_TYPE 1 SEGMENT SIZE 80,
    DATAHORA TIMESTAMP DEFAULT 'NOW');


ALTER TABLE TBMDF_LOGS
ADD CONSTRAINT PK_TBMDF_LOGS
PRIMARY KEY (ID);


CREATE SEQUENCE GTBMDF_LOGS;

CREATE TRIGGER TBMDF_LOGS_B01I FOR TBMDF_LOGS
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
  IF (NEW.ID IS NULL) THEN
    NEW.ID = GEN_ID(GTBMDF_LOGS,1);
END;

CREATE INDEX TBMDF_LOGS_01
ON TBMDF_LOGS (MDF_ID);

