Subject | Re: [IBO] Getting the value of a generator |
---|---|
Author | Lester Caine |
Post date | 2012-04-13T16:09:34Z |
Craig Cox wrote:
guaranteed unique. May leave holes if an update is not committed, but that
should not be a problem. If you NEED an ID number that does not have any gaps,
that is normally handled in a separate field, but normally it's not necessary.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
> As you can probably tell, I am using the primary key in my master table to identify records in a detail table. I am getting the anticipated value of the new master record before it is committed in case the user decides not to commit. If the user commits, it all goes great unless another user happens to sneak in. This will not likely be the case in this database (famous last words). I would, however, prefer to do it the right way, but not sure how to approach it. Any suggestions on avoiding mismatches?Just get the generator to increment itself when you access it. Every read is
guaranteed unique. May leave holes if an update is not committed, but that
should not be a problem. If you NEED an ID number that does not have any gaps,
that is normally handled in a separate field, but normally it's not necessary.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php