Subject | Re: [firebird-support] Synchonizing my generators |
---|---|
Author | Lee Jenkins |
Post date | 2004-04-23T13:02:05Z |
> And there I was, thinking we had cured you of your bad olddesktop-database
> habits! :-<// Hmmm. It appears that I need your book now, more than ever! Besides,
its not my fault, darn users insist on a robust product and it throws me off
sometimes :)
> Just DON'T do it. The point of having a generator is to ensure theI have just recently added the ability to export/import from the database of
> integrity of your unique series. You don't then go and blow that by
> introducing key values that originated somewhere else.
>
> If you need to keep a memory of the old key, store an extra column for
> it. Then, if you have to import details that have a foreign key
> referencing that original key, you can pick it up on a Before Insert
> trigger on the detail rows and update the key.
>
> It's not just a question of knowing the "highest" value: what happens if
> an introduced gen value turns up that the receiving database's generator
> has already used...?
our application so I'm still getting my head around this. I can see the
occasion when a user may want to transfer data from one database to another
(such as a product menu) as well as another table where the FK and PK keys
that relate those two tables is already established. I was trying to figure
out how to handle situations like this mostly. Seems I will have to think
of another way.
Thanks again,
Lee