Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Extract ORDER BY from cursor
Message
De
11/09/2008 19:48:38
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01346902
Message ID:
01346912
Vues:
11
>I have a view that displays table results (viewgrid). In order to have access to all fields in the primary table (incident) when printing, I create a very simple select command:
>
>
>select incident.* ;
>    from viewgrid, incident ;
>    where incident.inc_id = viewgrid.inc_id ;
>    into cursor printjob
>
>
>I would think that printjob would retain the fields in the order of viewgrid, but this is not happening. It seems to be in the natural order of incident.
>
>Is there something wrong with my select command? Should I be handling this differently?

There is no guarantee that data will be SELECTed in any particular order. Visual FoxPro may decide to use a particular order, as it deems best (i.e., to optimize the query). If you need data in any specific order, 'tis always best to explicitly include an ORDER BY clause.
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