*!* 建立测试表
CLOSE DATABASES
t1 = "c:\" + "tt1"
t2 = "d:\" + "tt2"
a1 = "tt1.dbf"
a2 = "tt1"
create TABLE &t1(id i,f1 c(10))
create TABLE &t2(id i,f1 c(10))
insert into &t1(id,f1) values (1,"")
insert into &t1(id,f1) values (2,"")
insert into &t1(id,f1) values (3,"")
insert into &t2(id,f1) values (1,"t1")
insert into &t2(id,f1) values (2,"t2")
insert into &t2(id,f1) values (4,"t4")
CLOSE DATABASES && 关闭建立的表,此时VFP环境中,没有打开的表了。
*!* 这里,不需要知道表名称和路径,利用别名,也不理后缀名称是否带 Dbf t1 = "c:\" + "tt1" 或者 t1 = "c:\" + "tt1.dbf" 都可以
update p1 set p1.f1=p2.f1 from &t1 as p1 ,&t2 as p2 where p1.id = p2.id
?&t1..id && 报错误,不识别
?&a1..id && 报错误,找不到对象Tt1;这里是 a1 = "tt1.dbf",表名,带后缀.DBF
?&a2..id && 正确,这里是 a2 = "tt1",表名称,不带后缀