Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting field names into a Comma Delimited File.
Message
De
20/12/1997 16:07:12
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00067402
Message ID:
00067404
Vues:
24
>I am creating a new table from an existing table with the following SQL
>statement:
>
>SELECT UPSINO AS equipnum, EQUIP_TYPE AS apprtype, MANUFACTUR AS mfr, ;
>SERIAL_NO AS serialnum, SUB_NAME as location, 'OILTRN' as rules ;
>FROM CNAME INTO DBF cnamecnv.dbf ORDER BY UPSINO
>
>I am creating a comma-delimited file from the new table, cnamecnv.dbf, with
>the COPY TO command as follows:
>
>     COPY TO ALIAS()+".txt" TYPE DELIMITED
>
>However, I need the first record of the TXT file to contain the field names
>of the table used to create the TXT file so it will import into my other
>application correctly.

I don't know what is your other application but here's a scenario, that if applicable, might be better.

Do you SQL as is. Then, from your other application, use the IMPORT feature to import directly from the table your SQL has created.

Or, if this is not possible, you may want to try doing the same but to add an additional step which will created a secondary text file which will hold the field headers and the current TXT just created. For that, you may use the low level file functions to create a new file, create the first lines as the header line and copy the TXT file into that one.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform