Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Michael Gill
  Where is Michael Gill?
 Flora
 Illinois - United States
 Michael Gill
 To: Kat Petitte
  
 
 
 Kat Petitte
 Tags
Subject: RE: replace command
Thread ID: 22710 Message ID: 22791 # Views: 0 # Ratings: 0
Version: Visual FoxPro 6 Category: Databases, Tables and SQL Server
Date: Friday, April 25, 2003 4:32:49 PM         
   


> not very familiar with foxpro -- just trying to port a program to a different language. could someone tell me what the change to table2 will be following these statements?
>
> select table1
> select table2
> append from table1
> replace all table2.commfac with table1.commfac_1
>
> assume tables as follows:
>
> table1: fields fileno, commfac_1
>
> 100 34.2
> 101 33.9
> 102 12.4
>
> table2: fields fileno, commfac
>

select table1  && Sets table1 as active work area &&
select table2  && Sets table2 as active work area instead of table1 &&
append from table1  && Adds all records with exact matching field names to table2 &&
replace all table2.commfac with table1.commfac_1  && Replaces all values in table2.commfac with the value of the current record from table1.commfac_1  &&

So you'll have a bunch of duplicate records. This code won't work to make a copy of your table.

Results of table2: fileno, commfac_1
100 34.2
101 34.2
102 34.2

---

www.foxite.com - The Home of the Visual FoxPro Experts

COMPLETE THREAD

replace command Posted by Kat Petitte @ 4/24/2003 9:18:11 AM
RE: replace command Posted by Kev InAz @ 4/24/2003 9:52:35 AM
RE: replace command Posted by Eric den Doop @ 4/24/2003 10:04:52 AM
RE: replace command Posted by Kev InAz @ 4/24/2003 10:10:50 AM
RE: replace command Posted by Kat Petitte @ 4/25/2003 1:05:57 AM
RE: replace command Posted by Rene Relucio @ 4/27/2003 10:40:30 AM
RE: replace command Posted by Michael Gill @ 4/25/2003 4:32:49 PM