Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help Adding Column to Cursor
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01173581
Message ID:
01173667
Vues:
28
>The ALTER TABLE command does not work if
>- a cursor has field names longer than 10 characters.
>- new filed name is longer than 10 characters.
>
>You may add a column using SELECT
SELECT *, CAST( 0 AS int) NewIntField ;
>FROM mycursor ;
>INTO CURSOR mycursor
>
>
>>You guys have been very helpfull in the past. Thank you ahead of time for any responses.
>>
>>I am trying to add a column to a cursor created by the Afields command but I am getting the error message on the alter statement: Field name is a duplicate or invalid.
>>
>>Select invoiceitems
>>ordnumfields = Afields(orditemfieldarray)
>>Create Cursor orditemview From Array orditemfieldarray
>>alter table orditemview add column toplevelitem c(20)
>>

Agree here... but also, if you just want an empty structure of the table with the extra column, just add a " WHERE .F. " to the SQL to prevent records in your new temp cursor... also add " READWRITE " to allow editing, adding to the new cursor like..
SELECT *, CAST( 0 AS int) NewIntField ;
  FROM mycursor ;
  WHERE .F.
  INTO CURSOR mycursor READWRITE
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform