Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record locking in a SQL Select
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01228210
Message ID:
01229644
Vues:
14
>>>>>>Hi John
>>>>>>
>>>>>>It doesn't matter if it's a UDF or a built-in VFP function. VFP always opens the tables again with different aliases while the query runs.
>>>>>>
>>>>>>recno is a built in function. Check the effects of the following:
>>>>>>
>>>>>>clear all
>>>>>>use sometable in a
>>>>>>select 0
>>>>>>select recno("sometable") from sometable
>>>>>>
>>>>>>You'll get 1 for all rows. The truth is you cannot be 100% sure what alias sometable will be in the query.
>>>>>
>>>>>Mike,
>>>>>I can't thank you enough for ruining my day. Here we thought we had it figured out and now you show us how wrong we were. I'm so glad you looked at this, otherwise we would have been in a heap of trouble when we sent our next update out all over the country. Talk about a bunch of bad phone calls.
>>>>>
>>>>>I guess the only way to do it in VFP is to get the recs with a SQL and then use the old scan loop to lock each one.
>>>>>
>>>>>Many thanks again,
>>>>>John.
>>>>
>>>>While this does work, I'd be hesitent to rely on it:
>>>>
>>>>
SELECT *,RLOCK() FROM  sometable WHERE somecondition INTO CURSOR other
>>>>
>>>>will lock records in sometable.
>>>
>>>Fred,
>>>funny you should say that. That was where this thread started. I tried it and it looked like it worked. Now, after Mike's comments, I think I will go back to the old way.
>>>Thanks for the input,
>>>John
>>
>>It only works as long as there is only one table in the select and you do NOT specify an alias in RLOCK().
>
>Fred,
>that is the way we are using it so I guess that's why it has worked so far. I guess we will go with it then for a while but keep an eye on it.
>Thanks again,

I'd keep a real close eye on it.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform