Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copying records
Message
De
06/05/1997 09:54:13
 
 
À
05/05/1997 17:56:37
Larry Long
ProgRes (Programming Resources)
Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00030828
Message ID:
00030981
Vues:
35
>>>>>I have an 'old' table, and a 'new' table (updated structure, new fields, validation rules, etc). I need to copy all of the records from the old table into the new. Most of the field names are the same, and all the new fields are placed at the end. Is there an automatic way to do this, or will I have to write a procedure? The full table has about 75 fields, and +/- 100,000 records. (Yes its normalized, just happens to be a big table). Thanks.
>>>>>
>>>>>Erik
>>>>
>>>>APPEND FROM ... FIELDS ...
>>>>will do this job.
>>>To handle the fields with different names I would...
>>>
>>>SELECT *, oldfieldname1 AS newfieldname1, oldfieldname2 AS newfieldname2, oldfieldname3 AS newfieldname3 FROM olddbf INTO CURSOR QUERY
>>>
>>>SELE 0
>>>USE newdbf
>>>APPEND FROM QUERY
>>
>>Thanks. Looks like this is what I'll have to do. I was hoping for something that would map the fields according to order in the table, so I could avoid naming all of the different fields, If I mistype anything, this could turn into a very long ordeal because of the size of the table and the number of records involved
>If the order of the fields are the same you could
>
>USE olddbf
>COPY TO tmpfile TYPE DELIMITED
>
>USE newdbf
>APPEND FROM tmpfile.TXT TYPE DELIMITED

Ahaa... that's exactly what I was looking for. I have even done this before, just couldn't remember how. Thanks Larry

Erik Moore
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform