Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Bryan Gerlach
  Where is Bryan Gerlach?
 Mesquite
 Texas - United States
 Bryan Gerlach
 To: Tamar Granor
  Where is Tamar Granor?
 Elkins Park
 Pennsylvania - United States
 Tamar Granor
 Tags
Subject: RE: append from cursor not working
Thread ID: 373772 Message ID: 373775 # Views: 50 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Tuesday, March 26, 2013 9:55:06 PM         
   


> > Hello everyone. I am having a problem while trying to append from a cursor or table. I have code to select one table to append from and another to append to. When I run the code, the destination table does not get appended correctly; instead, all the records are appended but with blank fields instead of the actual data. Here is an example:
> >
> > First table has two columns A1 and A2 and has around 200 records. A1 and A2 can both possibly be blank (it is uncommon that they both are, but it does happen). Second table has two columns F1 and F2, and is empty. After appending from the first table to the second, the second table now has around 200 blank records instead of records filled with data.
> >
> > What am I doing wrong? Also, all fields in both tables are character with length 100.
> >
> > My append line of code looks like this, after selecting the second table:
> >
> > APPEND FROM DBF('myCursor')
> > or
> > APPEND FROM myTable.dbf
> >
> > both have the same result.
>
> You can't use APPEND FROM if the field names don't match. Use SQL-Insert instead:
>
>
> INSERT INTO Table2 (F1, F2) ;
>    SELECT A1, A1 FROM Table1
> 

>
> Tamar



Thanks. That works perfectly.

ENTIRE THREAD

append from cursor not working Posted by Bryan Gerlach @ 3/26/2013 9:32:09 PM
RE: append from cursor not working Posted by Tamar Granor @ 3/26/2013 9:37:07 PM
RE: append from cursor not working Posted by Bryan Gerlach @ 3/26/2013 9:55:06 PM
RE: append from cursor not working Posted by Vladimir Zografski @ 3/26/2013 9:54:19 PM
RE: append from cursor not working Posted by Rahul Moudgill @ 3/27/2013 10:21:33 AM