Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unintelligent keys
Message
De
02/06/1999 22:30:16
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00224729
Message ID:
00225741
Vues:
11
>If my primary key is an unintelligent key that's an integer type, I can use only 4 places. What if I have more than 9,999 records in the table? Am I missing something fundamental?
>
>Thanks.

Hi, Jane.

See that you have received plenty of replies. Integer keys are definitely the way to go.

Here is an unsolicited tip. As Ed points out keys can be negative as well as positive. In my systems I don't like to delete records (for audit trail reasons and because carrying deleted records raises a number of indexing and Rushmore issues.) In most cases I just don't allow the user to delete a record, but in those cases where it makes sense to delete a child record, I change the keys from plus to minus.

Example:

PARENT RECORD -- Parent key = 12345

CHILD RECORD -- Child key = 654321, Parent key = 12345

After "deletion":

CHILD RECORD -- Child key = -654321, Parent key = -12345

Since the child record is now an "orphan", it has no effect on system functioning. But if things screw up and I'm trying to figure out what happened, I can still determine which parent record this child was attached to.

Peter
Peter Robinson ** Rodes Design ** Virginia
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform