Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy fields from one db to a different dbf
Message
From
02/02/2000 11:51:31
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00326203
Message ID:
00326208
Views:
24
Hi Becky,

Unless I am missing something, just open both tables (watch out for the differences between databases and tables -- I think you mean tables) and use the replace command with some sort of SCAN or loop for the scope. For example:
USE table1 IN 0
USE table2 IN 0
SELECT table1
SCAN
  SELECT table2
  LOCATE FOR table2.key = table1.key (or whatever works)
  REPLACE table2.thisfield WITH table1.thatfield (same data type I hope)
  SELECT table1
ENDSCAN
>vfp 3.0
>
>i am copying information from fields from one database
>to another database and field names are different.
>
>what is the best way to accomplish this? copy fields
>to arrays and then use replace command?
>
>do i need to open both databases at the same time to
>do this?
>
>Thanks and have a good day.
>
>Becky
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform