Subject Re: [IBO] Question about generato management
Author Marco Lauria
At 18.57 02/01/2003 +0100, you wrote:
>hello,
>
>Happy New Year to all of you.
>
>I was wondering what could be the differences and benefits (if any) of
>using the Generator_Link of an TIB_Query instead of managing the
>generator stuff directly with appropriate triggers (as I am actually
>doing) when inserting new rows.
>
>Regards
>Salvatore

If you issue a refresh after you insert a row and you fill the generator in
a trigger instead
of leaving ibo filling it, ibo would not know which is the PK of the new
row inserted.
I think this is the most important reason why you should use generatorlink
instead of managing
it in a trigger.
But if you don't need to be syncronized with the DB when you insert (such
as when you import data)
then the faster thing is to implement generators using triggers.
Usually I use in my trigger this syntax:
IF ( new.ID_TEST IS NULL ) then
new.ID_TEST = GEN_ID(TEST_GEN,1);

so I am able to use both solutions basing upon my specific needs.
Regards
Marco


Best Regards,
Marco Lauria
STARMAX s.a.s.
TEL. +39-091-6880476
FAX. +39-091-6887202
MOB. +39-348-3547034

[Non-text portions of this message have been removed]