Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Duplicate PK nos. allocated
Message
From
27/09/2006 08:21:07
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
 
 
To
25/09/2006 11:56:00
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
01156783
Message ID:
01157453
Views:
23
Hi Fabio, thanks for the reply.
IF 1 # SQLEXEC(lnConnHandle, ;
	 [;
DECLARE @newId INT;
UPDATE UniqueId SET @newId = nLastNumber = nLastNumber + 1 WHERE ]+m.lcFilter;
+ [ SELECT @newId AS nNewNumber], 'UniqueIdV')
  * ERROR
ENDIF
* nNewNumber
That's neat! A couple of questions...

a) SET @newId = nLastNumber = nLastNumber + 1. Is this the same as SET @NewId=nLastNumber+1,nLastNumber=@NewId (ie. SET both @newid and nLastNumber to nLastNumber+1)?

b) The code is not explicitly locking the record before the upddate. Does the UPDATE command guarantee a lock on the record? (In other words, do I definitely NOT need to wrap the code in a transaction?)

Regards,

Alan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform