CREATE TABLE PRODUTOS_SERVICOS (
ID_P_S INTEGER NOT NULL PRIMARY KEY,
DESCRICAO VARCHAR(90),
VALOR DECIMAL(15,2),
ID_PDV INTEGER,
ESTOQUE INTEGER
);

CREATE GENERATOR GEN_ID_P_S ;

SET TERM ^;

CREATE TRIGGER TRIG_GEN_ID_P_S FOR PRODUTOS_SERVICOS
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
   NEW.ID_P_S = gen_id(GEN_ID_P_S,1);
END
^

COMMIT WORK^
SET TERM;^
