Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Comparing two separate tables
Message
From
08/11/1996 13:30:50
Tony Catalano
Bennett and Williams Eci
Columbus, Ohio, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Comparing two separate tables
Miscellaneous
Thread ID:
00011841
Message ID:
00011841
Views:
54
I'm stuck. For the past month I have been trying to compare the contents of two tables within a data base, and identify any records that do not match. Each table (named pam93a & pam93b) contains 39 records, 10 fields long. The records that do not match are to be added to an "output" table. I have checked and double checked my code, but the program still has bugs in it. I purposely inserted, into pam93a, two mistakes, in order to see if the program would pick up on it. Instead of printing the two records that contain the mistakes it printed 1482 records, way more than the 39 in the table! Like I said, I'm stuck! If anyone can help I'd truely appreciate it. The actual code is listed below (It's Short)

open database gwdata
use pam93b in 0
use pam93a in 0
copy structure to output
add table output
use output in 0
dimension Tlist[1,10]

select pam93a
go 1
do while .T.
if eof ()
exit
endif
scatter to Tlist
dimension Clist[1,10]
select pam93b
scan
scatter to clist
for n = 1 to 10
set exact on
mv=ascan(Tlist, Clist[1,n],1)
if mv = 0
select output
append from array Tlist
skip
exit
endif
endfor
release CList
endscan
release all
select pam93a
skip
loop
enddo

By the way I'm a novice at this, so if you decide to answer you may have to reply to me like your talking to a 4-year old.

Thankyou for listening/reading


Anthony Catalano
Bennett & Williams ECI
Next
Reply
Map
View

Click here to load this message in the networking platform