Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NewID() working randomly
Message
 
To
19/08/1999 07:13:21
Rex Mahel
Realm Software, Llc
Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00254709
Message ID:
00255305
Views:
24
Rex -

To simplify my original message, the record locking feature of this procedure was left out. (It would be included in the "etc." part of the code displayed below. The DO WHILE ! llSuccess line starts that feature. It's not exactly a record lock, but it will keep the table in the view from distributing more than one unique value for a given table.

Thanks though!


>PMFJI, but the NewId table needs to be a table so you can lock the record until the value is iterated. If it were a view, two users could get the same value for the key but only one could update the underlying table correctly.
>
>HTH
>
>Rex
>

>>* Excerpt from function NewID()
>>*=================================
>>IF ! USED("rv_nextkey")
>> USE "eis!rv_nextkey" IN 0
>>ELSE
>> REQUERY("rv_nextkey")
>>ENDIF
>>
>>IF _TALLY = 1
>> MESSAGEBOX("_Tally was successfull")
>> SELECT rv_nextkey
>> llSuccess = .F.
>> DO WHILE ! llSuccess
>> lnRetVal = rv_nextkey.nextkey
>> REPLACE rv_nextkey.nextkey WITH rv_nextkey.nextkey + 1
>>*etc..
>>*=================================
>>
Previous
Reply
Map
View

Click here to load this message in the networking platform