CREATE TABLE PDV (
ID_PDV INTEGER NOT NULL PRIMARY KEY,
DESCRICAO VARCHAR(90),
ABREV VARCHAR(5),
TAXA DECIMAL(3,2)
);

CREATE GENERATOR GEN_ID_PDV ;

SET TERM ^;

CREATE TRIGGER TRIG_GEN_ID_PDV FOR PDV
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
   NEW.ID_PDV = gen_id(GEN_ID_PDV,1);
END
^

COMMIT WORK^
SET TERM;^
