CREATE TABLE RESERVA (
ID_RESERVA INTEGER NOT NULL PRIMARY KEY,
DATA_ENTRADA DATE,
HORA_ENTRADA TIME,
CONFIRMADA CHAR(1),
DATA_SAIDA DATE,
HORA_SAIDA TIME,
ID_CLIENTE INTEGER,
ID_UH INTEGER,
QTD_PESSOAS INTEGER,
OBS VARCHAR(250)
);

CREATE GENERATOR GEN_ID_RESERVA ;

SET TERM ^;

CREATE TRIGGER TRIG_GEN_ID_RESERVA FOR RESERVA
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
   NEW.ID_RESERVA = gen_id(GEN_ID_RESERVA,1);
END
^

COMMIT WORK^
SET TERM;^

INSERT INTO RESERVA (OBS) VALUES (null);