Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Pass Through Speed
Message
De
16/04/2004 10:20:34
 
 
À
16/04/2004 07:22:34
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00895472
Message ID:
00895529
Vues:
18
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform