CREATE TABLE NF (
ID_NF INTEGER NOT NULL PRIMARY KEY,
DATA_ENTRADA DATE,
DATA_SAIDA DATE,
ID_CLIENTE INTEGER,
ID_UH INTEGER,
QTD_ADULTOS INTEGER,
VALOR DECIMAL(15,2));

CREATE GENERATOR GEN_ID_NF ;

SET TERM ^;

CREATE TRIGGER TRIG_GEN_ID_NF FOR NF
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
   NEW.ID_NF = gen_id(GEN_ID_NF,1);
END
^

COMMIT WORK^
SET TERM;^

UPDATE PARAMETROS SET SCRIPT = 121;
