Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Duplicate PK nos. allocated
Message
De
27/09/2006 09:05:07
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
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:
01157458
Vues:
21
>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

a) Yes
b) Update implicitly locks (actually any block of codes are implicitly contained in an automatic transaction).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform