Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL error ordering an array by an unselected field.
Message
De
14/02/2001 13:41:23
 
 
À
14/02/2001 05:41:34
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00475580
Message ID:
00475910
Vues:
27
Hi Daniel,
Good idea. The workaround I had in mind was not that straight forward.

Thanks.

Daniel



>Daniel,
>
>I've seen this problem under Fox2.x, too.
>
>To work around it, you could do:
>
>SELECT MyField FROM MyTable ORDER BY MyOtherField
>COPY TO ARRAY MyArray
>
>
>HTH
>
>>Hi,
>> I ran into an interesting problem. Here is the code with the strange results.
>>
>>
>>SELECT filename.field_1;
>> FROM filename;
>> WHERE filename.field_2 = m.condition ;
>> ORDER BY filename.field_2 INTO ARRAY my_array
>>
>>
>>The problem is that the array being created by this code contains BOTH FIELD_1 and FIELD_2 information, interspersed in the same column. Very weird. I haven't noticed the error before, so I don't know if it's just some environmental setting that is wrong.
>>
>>I am able to recreate this problem with both Fox 2.6 DOS and WIN, however, the code performs correctly in VFP 6 and the beta of VFP 7.
>>
>>At this point, it looks like FoxPro 2.6 cannot handle ordering an array on a field not in the array. If I including the field in the select, I get the expected results, but lots of other code depends on the array having a single column
>>
>> If you could tell me how to change somthing in the environment, or somewhere to get the SELECT to give the expected results (an array ordered on field_2, containing data only from field_1) I would be greatful.
>>
>> If you know for certain that this is a bug in fox 2.6 I would also be greatful to know that.
>>
>> If not, I can think of several work arounds, but thanks for you time anyway.
>>
>>Thanks.
>>
>>Daniel
EMail: danielj@ryte-byte.com
"If I'm paddling so hard, how come I'm going backwards?" - Pinocchio (while the whale was swallowing him...)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform