Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record locking in a SQL Select
Message
From
31/05/2007 13:37:42
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01228210
Message ID:
01229630
Views:
27
Hi John

>>>Edward, you are right that the SQL is not locking the records. However, since the rlock() function is apparently working ok and returning .T. or .F. then I think it might be ok.
>>
>>That's exactly what I meant: it might be Ok, or it might be not. Using work area oriented UDF in Select-SQL is not reliable. I understand that it is the same work area for us (i.e. outisders), but internally VFP may create some temp. cursors switching areas and your RLOCK() may confuse it. You could do the same by plain SEEK/SCAN.
>
>Edward,
>I'm glad you keep challenging this. It makes me think more deeply about it. My thought on your comment about UDF is that the rlock() function is not a User Defined Function (UDF), it is a built in VFP function that is working directly on the table. Anyway, after trying it in a few more prgs it we have not found any problems, yet.

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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform