SET GENERATOR GEN_ID_PONTO TO 0;

DROP TABLE PONTO;

CREATE TABLE PONTO (
ID_PONTO INTEGER NOT NULL,
ID_FUNCIONARIO VARCHAR(14),
DATA DATE,
HORA TIME,
OBS VARCHAR(250),
TIPO VARCHAR(5),
HORA_DEFINIDA TIME,
FOTO VARCHAR(255),
USUARIO VARCHAR(10),
MARCACAO_AUTO CHAR(1),
ABONADO CHAR(1),
OK CHAR(1),
DATA_DEFINIDA DATE
);

SET TERM ^;

CREATE TRIGGER TRIG_GEN_ID_PONTO FOR PONTO
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
   NEW.ID_PONTO = gen_id(GEN_ID_PONTO,1);
END
 ^

COMMIT WORK ^
SET TERM ;^
