Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record Not Locked Error?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00762568
Message ID:
00764319
Vues:
29
Hi Steve,

Looks like it's a bug in UPDATE command. Here's code that repros it. The workaround is to use 'IN' operator instead of '=='.
CREATE TABLE testxx(cUserId c(40), iDel i)
Insert into testxx( cUserId, iDel ) values ( "a",0) 
Insert into testxx( cUserId, iDel ) values ( "aa",0) 
Insert into testxx( cUserId, iDel ) values ( "aa",0) 
Insert into testxx( cUserId, iDel ) values ( "b",0) 
USE testxx SHARED

Create Cursor seeme ( cUser c(40) )
Insert into seeme( cUser ) values ( "a") 
Insert into seeme( cUser ) values ( "b") 
Insert into seeme( cUser ) values ( "c") 

* The following commnd generates error "Record is not locked"
Update testxx Set iDel=1 ;
	Where Lower(cUserId) == ( Select Lower(cUser) from seeme )

* This works
Update testxx Set iDel=1 ;
	Where Lower(cUserId) IN ( Select Lower(cUser) from seeme )
>
>Create Cursor seeme ( cUser c(40) )
>Insert into seeme( cUser ) values ( "a")
>Insert into seeme( cUser ) values ( "b")
>Insert into seeme( cUser ) values ( "c")
>Update UserTable Set iDel=1 Where Lower(cUserId) == ( Select Lower(cUser) from seeme )
>
>
>That ends with an error "Record is not locked".
>
>This is all within the VFP8 command window. My Data Settings are
> [x] Automatic File Locking
> [x] Multiple Record Locks
> Buffering - Off
> Reprocessing - Attempt Lock (Default)
>because I think these are the default settings when the data is touched via the OLEDB driver.
>
>That did I miss?
>
>Thanks.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform