Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default unique ID values for a field in a remote table ?
Message
From
02/06/1998 15:22:51
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00103696
Message ID:
00104160
Views:
47
>Hi Andrea,
>
>>Uhmm, things are getting darker. What does 'surrogate keys' mean for you ?
>My definition would be Artificially generated primary keys values which the user doesn't see.

Then I'm not using them. I use the generated ID to identify the item represented by the record.

>I guess I went a little too fast here. The NewId() function would do exactly what you said. Moreover, the problem would come when the user adds a record and then Discards/Cancels it rather than saving it. When you add a record, the NewId() function would update the id in the ID table. When you discard/cancel the record the id is the incremented one so you lose one id in between.

Not in my case. I call the NewId() function only when the user ask to save the record, just before the TableUpdate()-related code. So I already know that the user has choosen to save the record. The only risk to lose the Id is when the TableUpdate() fails. But I could keep the lock on the Lookup table just until I've got the return value from TableUpdate()...
Sincerely,

Andrea Brajuka
Previous
Reply
Map
View

Click here to load this message in the networking platform