CREATE TABLE UH_INDISPONIVEL (
ID_UH_INDISPONIVEL INTEGER NOT NULL PRIMARY KEY,
DATA_INICIO DATE,
HORA_INICIO TIME,
DATA_TERMINO DATE,
HORA_TERMINO TIME,
ID_UH INTEGER,
OBS VARCHAR(250)
);

CREATE GENERATOR GEN_ID_UH_INDISPONIVEL ;

SET TERM ^;

CREATE TRIGGER TRIG_GEN_ID_UH_INDISPONIVEL FOR UH_INDISPONIVEL
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
   NEW.ID_UH_INDISPONIVEL = gen_id(GEN_ID_UH_INDISPONIVEL,1);
END
^

COMMIT WORK^
SET TERM;^
