Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Two fields having the same name
Message
De
09/10/1996 09:32:56
Paul Wei
Fib, State of Michigan
Lansing, Michigan, États-Unis
 
 
À
08/10/1996 17:11:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00009656
Message ID:
00009686
Vues:
41
>Yes, I have two fields having the same name in my table and here is why.
>
>From the mainframe, someone is running an extraction program which will extract some data to a DBF format. On the mainframe, they have those long field names having more than 25 characters. Some of them have the same first 15 characters. The extraction work but when I use this table in Visual FoxPro I have two fields having the same name.
>
>Now, the problem is how to make reference to the first field or the second field?
>
>If I use the table and just say ? first_field, Visual FoxPro will show me the value of the second field and sometimes it's the first field.
>
>We have another extraction program at the Visual FoxPro level and we need to find a mecanism to make reference to one of those field.

Don't know if this will work all the time. Assume you have two fields with the same name "aaaaabbbbbccccc" in table "dummy". You can use the "alter table" command to change the name of one of the field:

ALTER TABLE dummy RENAME COLUM aaaaabbbbbccccc TO newname

You can always hope that the "alter table" command will consistently change the name of the first of the two dup fields, it seems to work that way. But one can never tell, it may find and change the name of the second field on the 101th try.

Paul
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform