Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: Eddie Ruiz
  Where is Eddie Ruiz?
 Hawthorne
 United States
 Eddie Ruiz
 Tags
Subject: RE: Transfer data from dbf1 to dbf2
Thread ID: 373898 Message ID: 373899 # Views: 50 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Thursday, March 28, 2013 5:26:33 PM         
   


> Hi, I need some help.
> I have 2 identical dbfs with the same fields, dbf1 has data, dbf2 doesn't. What code can I use to transfer the data from dbf1 to dbf2?
> Thank You

Assuming the fields are also in the same order (even though not nessarily name identically):
INSERT INTO Dbf2 SELECT * FROM Dbf1

If there are missing coliumns, or the order is not right:
INSERT INTO Dbf2 (<column-list>) SELECT <column-list> FROM Dbf2 

If they have the same names (and data types), but regardless of order:
SELECT Dbf2
APPEND FROM Dbf1 
Any column with no matching name will be ignored.
If the source is not a table but a cursor use FROM DBF('cAlias')

-Anders

ENTIRE THREAD

Transfer data from dbf1 to dbf2 Posted by Luis DeGante @ 3/28/2013 5:22:05 PM
RE: Transfer data from dbf1 to dbf2 Posted by Anders Altberg @ 3/28/2013 5:26:33 PM