Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Annoying behaviour when adding a field to a table...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00413032
Message ID:
00413039
Vues:
22
>Everyone,
>
>I'm generating a cursor using "CREATE CURSOR < Name > FROM ARRAY < Array >", but further down the line I want to "Add" a column to the Table. To do this I use "ALTER TABLE < Name > ADD COLUMN < Name > < Type >".
>
>The problem is, some of the columns in the table I originally created have names longer than 10 chars and when I add the column with the "ALTER TABLE" command it truncates the other field names to be 10 chars also.
>
>How can I add my column and avoid truncating the existing field names?
>
>Thanks,
>
>- Aaron.

You can't. Once you start ALTERing a cursor, you use its free table (the TMP file returned by DBF()), which can't have field names >10 chars in length.

Assuming this array came from an AFIELDS() call, I would recommend just adding the new fields to the array before creating the cursor.
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform