Subject Generator Problem. Values = 2, 4, 6, 8, 10,...
Author mcrosman1957
Hi.

I am using Delphi 6.0, Firebird 1.0.0.338
and Interbase Express components: IBDataset, IBTransaction, IBSQL.

I have created a generator with the statement:

Create Generator PCOrc_Gen;

And a trigger for this generator with the statements:
=====================
SET TERM #
CREATE TRIGGER SET_NumReg_PCOrc FOR PLANCONORC
Active Before INSERT Position 0 AS
begin
IF (new.NumReg IS NULL) then
new.NumReg = gen_id(PCOrc_GEN,1);
end #
SET TERM ;#
========================

I have noticed that every time a do a insert the values generated for
the NumReg primary key are 2, 4, 6, 8, 10,... and not 1, 2, 3, 4, 5,
6, 7, 8,...

Why does it happen? How can I solve this problem?

Thanks for any help.

Marcelo.