Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is more efficient of the two
Message
From
12/07/2006 07:52:48
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
01135592
Message ID:
01135632
Views:
12
>Hi Borislav
>
>>If you SCAN through relatively small ammount of records maybe the difference in speed will not be visible, if you have many ecords in SCAN I expect this to be faster because your query is compiled at SQL Server side and SQL Query optimizer is already done its job and after you issue SQLEXEC() its just follow the execution plan. But as I said this is only my expectations.
>
>Thanks a lot for the idea. I will definately give it a try.

You can do another way
prepare an indexed result cursor with CREATE CURSOR
SCAN spt cursor
    Build a select clause with IN ( primary keys ) based on source spt cursor
    if n records
       SQLEXEC() 
       insert into result from spt cursor
       reset SQL Command
ENDSCAN

then 
SCAN
    SEEK result cursor
    do stuff
ENDSCAN
If you already know record range, I think that it will be faster to get both cursors first
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform