I need to check one table against another so what I want to do is select record 1 in table A and then compare that record to All records in Table B. Then I want to output any records that do not have a match?
hi tcstudio
test the following example with 3 character fields, is that what you are after ?
* create 2 tables with data
numofrecs = 2
create table studioa (field1 c(50), field2 c(50), field3 c(50))
do populate
create table studiob (field1 c(50), field2 c(50), field3 c(50))
append from studioa
do populate
* output records that do not have a match
close data
create table studioc (field1 c(50), field2 c(50), field3 c(50)) && to hold answers
use studioa in 0 && from table creation above
use studiob in 0 && from table creation above
select studioa
index on field1+field2+field3 tag seekstr additive
select studiob
scan
scatter memvar
m.seekstr = field1+field2+field3
if not seek(m.seekstr,"studioa"
insert into studioc values (m.field1, m.field2, m.field3)
endif
endscan
* browse your data files
procedure populate
for i = 1 to numofrecs
m.info = '_'+alltrim(str(i))+'_'+alias()
insert into (alias()) values ( 'f1'+m.info, 'f2'+m.info, 'f3'+m.info )
endfor
return
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.