Subject RE: [IBO] GeneratorLinks in 5,000,000 words or less
Author Michael L. Horne
Hello Paul

GeneratorLinks is to allow IBO to go ahead and get the
ID of the record before the actual insert. This allows
it to pass it along to Detail tables that could be connected
and other things. You don't have to use it for positioning,
I think you are talking about keylinks.

I use the following trigger on my tables:

create trigger TRGBEFINS_Customer for Customer
active before insert position 0
as
DECLARE VARIABLE Temp_ID integer;
begin
if ((new.Cus_ID is NULL) or (new.cus_ID = 0)) then
begin
new.Cus_ID = gen_id (Gen_Customer_ID, 1);
end else begin
Temp_ID = gen_id(Gen_Customer_ID,0);
if (new.CUS_ID > Temp_ID) then
begin
Temp_ID = gen_id(Gen_Customer_ID, new.Cus_ID-Temp_ID);
end
end
end

It will update your generator if necessary and also, make
sure that the generator doesn't get behind if you inserted
records that had IDs not derived from the generator.

Good Luck
Michael L. Horne


> -----Original Message-----
> From: Paul Schmidt [mailto:paul@...]
> Sent: Wednesday, February 07, 2001 3:30 PM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] GeneratorLinks in 5,000,000 words or less
>
>
> Hi Everybody:
>
> I have heard about then GeneratorLinks property, but the
> documentation isn't quite clear, on how it works. Could someone
> explain it using 5,000,000 words or less. :-))
>
> I understand that without using it, IBO could lose it's positioning
> on the record. Fair enough, however does this mean you eliminate the
> trigger and use generator links instead, or does GeneratorLinks work
> along side the trigger, to get the positioning info.
>
> In my case, I don't want to lose the position of the record, but I
> like the idea of using the trigger, as it allows non-IBO environments
> (I am thinking Perl here) to update the database as well.
>
> BTW anyone know of a good IB-Perl interface, needs to be usable under
> Windows and also Unix (any Unix FB and Apache can run on).
>
>
> Thanks in advance,.
>
>
> Paul
> Paul Schmidt,
> Tricat Technologies
> Email: paul@...
> Website: www.tricattechnologies.com
>
>
>
>