CREATE TABLE TBPDV_VENDEDOR (
    ID INTEGER NOT NULL,
    VENDEDOR_ID INTEGER,
    PDV_ID INTEGER);

ALTER TABLE TBPDV_VENDEDOR
ADD CONSTRAINT PK_TBPDV_VENDEDOR
PRIMARY KEY (ID);

CREATE SEQUENCE GTBPDV_VENDEDOR;

create trigger ttbpdv_vendedor_b01i for tbpdv_vendedor
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gtbpdv_vendedor,1);
end;