Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Pass Through Speed
Message
From
16/04/2004 10:20:34
 
 
To
16/04/2004 07:22:34
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00895472
Message ID:
00895529
Views:
20
Ok,

So you are selecting data from a local table, and finding something from a remote table?

How many records is the local query returning?

Now, you are scanning the local table, and then scanning the remote table for each record in the local table. This is very inefficient.

Also, do you have to do a LIKE on PARTNO with a percent sign surrounding it? The info you are looking for doesn't have the full partno? That is very inefficient also.

Anyway... what I would do it insert the results of the local query into a remote table... Then, run a single query on the back end that joins to this remote table. This way, there is only 1 call to the back end to do your big query and all the work happens on the server.

Or, if the result set from the local table is small, you can build the select like:
cSelect = [SELECT * FROM Whatever WHERE ]
SCAN
   cSelect = cSelect + [PartNo LIKE '%]+cPartNo+[%' OR ]
ENDSCAN

** Take last "or" off end
if right(cSelect,2) = 2
   cSelect = Left(cSelect, len(cSelect)-2)
endif
Now send that to the back end, so you are making one trip to the back end.

Does any of this make sense?

BOb
Previous
Reply
Map
View

Click here to load this message in the networking platform