Subject Re: [firebird-support] Re: Auto-increment and generators
Author Phil Shrimpton
On Wednesday 11 February 2004 08:00, h_urlaf wrote:

Hi,

> > Repeat after me, Primary Keys should not contain business data....
> > Primary Keys should not contain business data....
>
> I don't need to; it already isn't the case.

In the app, or in the DB?

> > Business data can, and will change, but 'meaningless' values won't.
> > 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.
>
> That is exactly what I have. We don't know what bussiness data a
> customer will choose for the mailbox ID, *if any*. All we know is that
> it will be numeric, and unique.

I would still make the PK for the 'mailbox' record a 'generator', and make
the mailBoxID a separate field with a unique index, keeping the PK 'hidden'
from the UI. The PK should eb meaningless, and the mailboxid is really
business data with a business rule, so it should be kept separate, IMO.

Phil
--
Discover a lost art - play Marbles
April 2004
ICQ: 760757 | AIM: pjshrimpton | Y!: pjshrimpton | pjshrimpton@...