Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating Primary keys
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00005298
Message ID:
00005315
Vues:
24
>Some people in FoxPro Windows 2.6 we using the binary key for their unique id to save some space. In Visual FoxPro with the integer field, most of the people are now using the integer field.

I decided that even though an integer allows 2 billion unique values (4 including neg.) that I would rather use a character value. I still have a counter file that I use to increment the counters, etc., but when I store the value as a primary key, I convert it to binary character data. This allows me to use primary keys that can grow in the future to whatever size I want. 2 billion seems like a lot, but you never know in Client Serve (s). Anyway when I designed the character data I was thinking more in terms of shorting the size to 3 or 2 bytes depending upon what the table was used for.

Another advantage of character primary keys is that you can concatenate them with other character keys which is very useful when you need to set up complex relations.

Peter
Peter Stephens
Visual Records, Inc.

Lead Programmer for the general purpose record keeping system Visual Records. Written primarily in VFP 6.0 with a little C++.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform