Subject Re: [firebird-support] Generator limits
Author Paul Vinkenoog
Hello Magni Thor Mortensen,

>>> My plan is to create a generator for each row in a table by an
>>> after insert trigger.

> Why is it a bad idea ?

Because it's silly, that's why ;-)

> I intend to use these generator to create transaction numbers for
> rows in another table:
>
> table_1
> serie PK
>
> Create trigger table_1_gen for table_1 after insert as begin
> execute statement 'create generator g_' || new.serie;
> end
>
> table_2
> serie PK (FK table 1)
> tr PK
>
> I must have a unique sequential tr number in table 2 and I thought
> it best to use generators to prevent conflicts. But I would
> appreciate any suggestions.

I'm not sure I understand precisely what you want, but if you need
unique transaction numbers to feed table_2.tr, then you need *one*
generator for that column.


Greetings,
Paul Vinkenoog

(BTW, max generators in Fb2 is 32758, in 1.x it's one more. For free!
See http://www.firebirdsql.org/pdfmanual/Firebird-Generator-Guide.pdf
or http://www.firebirdsql.org/manual/generatorguide-basics.html#generatorguide-basics-howmany)