English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i am using visual foxpro. I have 2 tables with 1 field and millions of records. i need the lines of code that will go through the second table and find records that match the 1st tables records and mard them to delete or whatever code you can give me that will do that
thanks

2006-08-24 08:34:49 · 1 answers · asked by daniel e 3 in Computers & Internet Programming & Design

1 answers

sele a
use 1sttable &&(open 1st table)
index on fld1 tag fld1 additive &&(create index)

sele b
use 2ndtable &&(open 2nd table)
index on fld2 tag fld2 additive &&(create index)
go top
do while !eof() &&(go through 2ndtable from beg to end)
sele 1sttable
set orde to fld1
go top
seek 2ndtable.fld2 && find matching record in 1stable
if found()
delete
endif
sele 2ndtable
if !eof()
skip
endif
enddo

put the above code in a prg and run

2006-08-25 21:06:01 · answer #1 · answered by lakshmi r 4 · 0 0

fedest.com, questions and answers