同名字段替换找不到列
程序代码:
create cursor b1 (jnh N(2),m1 c(3),m2 c(3)) insert into b1 values (1,"","") insert into b1 values (2,"","") insert into b1 values (3,"","") insert into b1 values (4,"","") insert into b1 values (5,"","") create cursor b2 (jnh N(2),m1 c(3),m2 c(3)) insert into b2 values (1,'M1',"") insert into b2 values (3,"M1","M2") insert into b2 values (4,"M1","") ***b1、b2字段名同,但记录数不同 SeLe b1 mcount=Afields(marray) FOR i=1 TO mcount UPDATE b1 SET b1.marray(i,1)=b2.marray(i,1) from b2 WHERE b1.jnh==b2.jnh &&用b2替换b1相同字段 ENDFOR
运行时提示:SQL找不到列
但单独测试又找得到字段名
不知问题在哪?
如果部分字段名相同,能否用b2替换b1同名字段值?
如:
程序代码:
create cursor b1 (jnh N(2),,m0 c(3),m1 c(3),m2 c(3),m3 c(3),) insert into b1 values (1,"","","","") insert into b1 values (2,"","","","") insert into b1 values (3,"","","","") insert into b1 values (4,"","","","") insert into b1 values (5,"","","","") create cursor b2 (jnh N(2),m1 c(3),m2 c(3)) insert into b2 values (1,'M1',"") insert into b2 values (3,"M1","M2") insert into b2 values (4,"M1","")
[此贴子已经被作者于2020-10-22 18:16编辑过]