Subject Re: [firebird-support] Synchonizing my generators
Author Nando Dessena
Lee,

LJ> Sometimes we need to import data into our database and many times the key
LJ> primary key field is supplied during the import. Is there a way for me to
LJ> check each generator against the table that uses it, see what the highest
LJ> value of the pk field is and increment the generator used for that field by
LJ> one more?

LJ> Or is it something I will to hard code for each table? I would be nice to
LJ> create either a SP or a tight looping routine from the client do it.

you can do it both ways (a stored procedure using EXECUTE STATEMENT in
a loop or a client side loop), provided you have a way to map table
names, key columns names, and generator names. A consistent naming
scheme usually helps in these cases.

BUT you'll have to be connected as the sole user to the database.
That's the only case in which fiddling with generator values might be
regarded as acceptable.

Ciao
--
Nando mailto:nandod@...