Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Assigning Primary Keys
Message
 
To
28/01/1999 16:29:25
Steve Summers
Pima County Superior Court
Tucson, Arizona, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00181534
Message ID:
00181734
Views:
11
>I know of no way to place a record lock on the table with all my keys using SQL.

The code in line [2] will place a record lock and the record will be released in line [4]. This is by definition and it is done automatically. The following code it is the core of a key generator routine.

[1] begin transaction
[2] update KeyTable set NextKey = NextKey + 1
[3] select NextKey from KeyTable where KeyTable.PK = ‘somevalue’
[4] commit transaction

The above code will NOT generate dead-lock conditions because the use of begin transaction/commit transaction.

The table 'KeyTable' will be open automatically for you. Just make sure the database container (DBC) it is open.

> Are you recommending I change the use command to a SQL Select (Which should open the table)?
Yes. Well it is just an idea. I have no idea on the impact that this could have on your project.
Hector Correa
Previous
Reply
Map
View

Click here to load this message in the networking platform