Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to execute SQL in DESC order?
Message
De
24/07/2001 07:56:30
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
24/07/2001 07:35:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00534288
Message ID:
00534304
Vues:
11
>Hi,
> I would like to execute a cursor in DESC order. Any ideas?
> I have a query that select records from stock table. I need to process it again by DESC order. However, VFP keep execute it by ASC order even I have ORDER BY DESC for previous query result. Any ideas?
>
>Thnak you

Because of Rushmore Optimization, Visual FoxPro might re-arrange records in commands that accept a scope. In other words, Visual FoxPro assumes that it doesn't matter in which order you process the records. Sometimes, this assumption is wrong.

Workarounds:

Try to add NOFILTER to your query. This will create a separate table, instead of Visual FoxPro internally applying the equivalent of SET FILTER.

Say you are using a command like REPLACE ALL ..., try replacing it with

SCAN
REPLACE ... (single record)
ENDSCAN

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform