Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unique ID
Message
From
30/08/2004 11:07:05
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
30/08/2004 09:39:50
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00937563
Message ID:
00937624
Views:
9
>What is the best method for creating a unique id for a record when multiole users are creating records at the same time?

You can have a table, SerialNumber, which stors the next number to be used for each PK or other sequence number.

A UDF, also called SerialNumber, will locate the corresponding record, lock the record briefly, increment it, and return either the old or the new value.

If a table's PK is not visible to the user, just assign your UDF as the default value for the PK field.
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