Subject | Re: Auto-increment and generators |
---|---|
Author | h_urlaf |
Post date | 2004-02-11T08:00:35Z |
--- In firebird-support@yahoogroups.com, Phil Shrimpton <phil@s...> wrote:
which is his PK. He *also* has a mailbox ID, which is 'bussiness
data'. It must be unique, and since most clients don't care what it is
(do not wish to link it to bussiness data), we would prefer to
auto-generate it, and offer the client an interface to change the
auto-generated mailbox numbers to numbers that are meaningful within
the organization.
customer will choose for the mailbox ID, *if any*. All we know is that
it will be numeric, and unique.
Emiliano
> > So would I, but here's the situation: we have a 'mailbox ID' thatI don't need to; it already isn't the case. The user has a UserID,
> > is generally random (doesn't matter, as long as it's unique). Some
> > organizations, however, want to specifically set this ID at some
> > point (to phone numbers, personnel ID, what-have-you), and this
> > change may have to happen on a database that is already deployed.
>
> Repeat after me, Primary Keys should not contain business data....
> Primary Keys should not contain business data....
which is his PK. He *also* has a mailbox ID, which is 'bussiness
data'. It must be unique, and since most clients don't care what it is
(do not wish to link it to bussiness data), we would prefer to
auto-generate it, and offer the client an interface to change the
auto-generated mailbox numbers to numbers that are meaningful within
the organization.
> Business data can, and will change, but 'meaningless' values won't.That is exactly what I have. We don't know what bussiness data a
> If a 'mailbox' record needs to contain a unique 'personnel ID' or
> 'phone number' make it a separate field and slap a unique index on
> it.
customer will choose for the mailbox ID, *if any*. All we know is that
it will be numeric, and unique.
Emiliano