Subject Generator Problem Solved.
Author mcrosman1957
Hi.

The generator problem has been solved.

I was incrementing the generator value twice: by the trigger and by
the settings of the GeneratorField property of IBDataset.

I have removed the settings of the GeneratorField of IBDataset and
now it is OK.

Thank you all for your help.

Best regards,

Marcelo.


--- In ib-support@y..., "mcrosman1957" <delphi7@b...> wrote:
> OK.
>
> I will remove the generator field set of IBDataset.
>
> Thank you.
>
> Marcelo.
>
> --- In ib-support@y..., "Alan McDonald" <alan@m...> wrote:
> > so you either don't need the trigger or you don't need to have the
> > generatorfield set
> > up to you
> > -----Original Message-----
> > From: mcrosman1957 [mailto:delphi7@b...]
> > Sent: Saturday, 28 September 2002 10:22
> > To: ib-support@y...
> > Subject: [ib-support] Re: Generator Problem. Values = 2, 4, 6,
8,
> 10,...
> >
> >
> > Hi.
> >
> > Yes, I am using IBDatset.
> > I have set the generator field of the IBDatase to the generator
> > PCOrc_Gen.
> >
> > Thanks,
> >
> > Marcelo
> > --- In ib-support@y..., "Alan McDonald" <alan@m...> wrote:
> > > IBDataset has a generetorfield where you declare the
generator -
> it
> > will get
> > > a value, then you insert a null and the trigger gets a value
> > > are you sure you are not using IBdataset?
> > > -----Original Message-----
> > > From: mcrosman1957 [mailto:delphi7@b...]
> > > Sent: Saturday, 28 September 2002 9:59
> > > To: ib-support@y...
> > > Subject: [ib-support] Generator Problem. Values = 2, 4, 6,
8,
> > 10,...
> > >
> > >
> > > 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.
> > >
> > >
> > >
> > > To unsubscribe from this group, send an email to:
> > > ib-support-unsubscribe@e...
> > >
> > >
> > >
> > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> > Service.
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> >
> >
> > To unsubscribe from this group, send an email to:
> > ib-support-unsubscribe@e...
> >
> >
> >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
> >
> >
> >
> > [Non-text portions of this message have been removed]