Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Primary and Candidate
Message
De
03/08/2001 16:44:18
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
03/08/2001 14:51:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00538812
Message ID:
00539663
Vues:
15
>Hilmar:
>
>LOL. It looks like I'm the one who is missing something... Old age I guess.
>
>Daniel

You mentioned GUIDs. A while ago, I thought about another alternative, for distributed applications (i.e., where the users can't connect all the time to a centralized network):

  • Assign a unique number to each user.
  • For the primary key, use two integer fields: the user number and an auto-generated integer.

    That was what I thought some three years ago. Now, it occurs to me that joins on two fields are too complicated, so you could join the information into a single field - this field might be defined as C(6).

    For instance, for the primary key for an invoice table, the expression for the default value might be: bintoc(gnUserNumber,2) + bintoc(serialnumber("invoice",4)). This gives 6 bytes, instead of 16. Uniqueness is assured.

    However, I didn't actually put this concept into practice, and I don't even think this solves all problems of distributed computing. For instance, there are problems when users want to share information, like clients or cities (you don't want two users to record the same client, country, or city, twice!).

    Hilmar.
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Précédent
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform