Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Duplicate PK nos. allocated
Message
De
27/09/2006 11:22:35
 
 
À
27/09/2006 08:21:07
Alan Harris-Reid
Baseline Data Services
Devon, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
01156783
Message ID:
01157519
Vues:
24
>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)?
>

Yes

>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?)
>

Yes

>Regards,
>
>Alan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform