CREATE TABLE OCUPACAO (
ID_OCUPACAO INTEGER NOT NULL PRIMARY KEY,
ID_ENTRADA INTEGER,
DATA DATE,
VALOR DECIMAL(15,2),
QTD INTEGER
);

CREATE GENERATOR GEN_ID_OCUPACAO ;

SET TERM ^;

CREATE TRIGGER TRIG_GEN_ID_OCUPACAO FOR OCUPACAO
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
   NEW.ID_OCUPACAO = gen_id(GEN_ID_OCUPACAO,1);
END
^

COMMIT WORK^
SET TERM;^
