Subject Re: Generators Associated with a Table
Author Svein Erling
It is quite common to have triggers firing and inserting the PK
(through a generator) when the column is NULL. If the table is
designed this way, you could simply drop the PK column from your
insert, things will get updated and the trigger used.

Set
- I support Firebird, I am a FirebirdSQL Foundation member.
- Join today at http://www.firebirdsql.org/ff/foundation

--- In firebird-support@yahoogroups.com, Lee Jenkins wrote:
> Thomas Steinmaurer wrote:
>
> > Lee,
> >
> >>Is there a way to query the system tables to retrieve the
> >>generator (if any) that is being used by that table?
> >
> > You probably use a generator to increment the value of
> > a primary key column for your table, but the generator
> > doesn't stand in any relationship to a table.
> >
> > That means, you can create a generator without having
> > any table in your database.
>
> So no way to figure out which generators, if any, a table is using.
> Makes sense, given the nature of generators. Hmmm. Maybe I could
> just use a separate table and store the values of the generator
> names there.
>
> I'm thinking about building an import utility that will bulk process
> INSERTS into a DB but don't want to get in trouble with the
> generators lagging behind cause PK violations.
>
> Lee