Subject Re: [firebird-support] Auto Incrementing field
Author Alex Taylor
Yes they are right above. The general implementation of an
auto-increment field in FireBird is to create a BeforeInsert trigger and
a generator for that field. In the BI trigger write the following:

IF NEW.YOUR_FIELD_NAME IS NULL THEN
BEGIN
NEW.YOUR_FIELD_NAME=GEN_ID(GEN_YOUR_FIELD_NAME,1);
END

This will ensure a unique value for that field and will insert a value
only if the value being inserted is null. This is usefull when you
insert via script and then there is no need to deactivate the trigger.

Regards:Alex