Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem for getting infromation from the table.
Message
De
09/01/2002 06:45:08
 
 
À
09/01/2002 03:02:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00602363
Message ID:
00602414
Vues:
14
>>I am using the cross-tab query, every time when query is generate it create new field name. I have problem for getting the information from the table because I do not know the field name. Field() function tell me about the name of field but when I use it with the table name it does not show the information and generate the Error.
>>
>>For example :
>>
>>Table name = Address && getting cursor through cross-tab procedure.
>>Filed name = field(1) && it show the field name “Street”
>>When I use this with the table name it generates Error.
>>
>>---------------------------------------------
>>Method 1
>>--------
>>1- X = address.field(1) && generate error…..
>>
>>Method 2
>>--------
>>1- f_name = field(1)
>>2- X = address.f_name or address.&f_name && generate error.
>>---------------------------------------------
>>
>
>At least one correct method:
>
>
x=eval('address.'+field(1))
>
>>I have problem that I do not know the field name but I want to get the information from the table ….
>>
>
>Use AFIELDS() to get the array of field names and use the field name values either with EVAL() or name resolution. And you can always use SCATTER TO ArrayName to populate a array with field contents, or SCATTER TO NAME ObjName to create an object whose properties are the field names and the content is the field value, or SELECT into a 2D array if the data set is small enough.

Ed Rauh,
THANKS A LOT, Yes this is a correct soultion.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform