Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Primary and Candidate
Message
From
03/08/2001 16:44:18
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
03/08/2001 14:51:21
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00538812
Message ID:
00539663
Views:
14
>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)
  • Previous
    Reply
    Map
    View

    Click here to load this message in the networking platform