CREATE TABLE UH (
ID_UH INTEGER NOT NULL PRIMARY KEY,
NUMERO VARCHAR(5),
DESCRICAO VARCHAR(30),
ID_TIPO_UH INTEGER,
RAMAL VARCHAR(10)
);

CREATE GENERATOR GEN_ID_UH ;

SET TERM ^;

CREATE TRIGGER TRIG_GEN_ID_UH FOR UH
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
   NEW.ID_UH = gen_id(GEN_ID_UH,1);
END
^

COMMIT WORK^
SET TERM;^
