Subject Re: [firebird-support] Unique gen_id name needed for each trigger?
Author Lester Caine
dleec45 wrote:

> I'm trying to set up my first FB1.5 db and have a number of tables
> that are being converted from MySQL where the key ID was auto
> incriment. If I set up a trigger to do this function BEFORE INSERT,
> do I need a unique generator id for each table as in:
>
> NEW.ID GEN_ID(addr_gen_ID, 1);
>
> In this example addr_gen_ID happend to be used my address table and
> cannot be used as a generic generator for ALL tables? RIGHT?? I
> can't find this anywhere in the docs.

If you are only going to be entering a few hundred thousand records in
each table, then there is no problem using the one generator in all the
tables. Then the addr_gen_ID will be unique across all of the tables.
Unlike MySQL there is no link between the table and the generator other
than the ones you create yourself, so create generator, and use it in
each table - each call to the generator will get the next number without
any problem.

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services