Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Import Question
Message
From
30/04/1999 13:00:04
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00213861
Message ID:
00213973
Views:
39
George,

Thanks - I was hoping for a parameter, setting , or clause for a built-in function rather than a procedure. BTW - what I ended up using (after import) was the following which works fine:


LOCAL lncount, i

USE MyTable
lncount = FCOUNT()

LOCAL ARRAY aName[lnCount, 2]
GO TOP

FOR i = 1 TO lncount
aName[i, 1] = FIELD[i]
aName[i, 2] = ALLT(EVAL(FIELD(i)))
ENDFOR

FOR i = 1 TO lncount
ALTER TABLE MyTable RENAME COLUMN (aName[i, 1]) TO (aName[i, 2])
ENDFOR

GO TOP
DELETE
PACK
USE IN MyTable


>Provided I knew the data types and length of the fields, I'd first use low level file I/O to pull the first "record" into a string. I'd then parse it using the Foxtools functions Words() and WordNum(), to retieve the individual field names. These would be stored in an array that was the number of fields in length and have 4 columns with the first being the field name.
>
>This array would then be used to create a cursor using CREATE CURSOR...FROM ARRAY... I'd also use the low level file functions to re-write the file excluding the first entry (the fields). Then I'd append from the file, and copy to the table.
>
>Does this help?
Ken B. Matson
GCom2 Solutions
Previous
Reply
Map
View

Click here to load this message in the networking platform