建一个字符串型数组var databasename:array[1..7]of string; i:integer;procedure .............. begin databasename[1]:='表一的名字'; databasename[2]:='表二的名字'; . . . for i:=1 to 7 do with table1 do begin close; tablebame:=databasename[i]; open; edit; table1['hpbh']:='m'; post; end; end;暂时想到这个方法
如有表t1,...t7 均有hpdh 在sql 的database上 create view test select t1.hpdh h1,t2.hpdh h2,...t7.hpdh h7 from t1,t2,...t7 where t1.hpdh=t2.hpdh and t1.hpdh=t3.hpdh and t1.hpdh = t4.hpdh ... and t1.hpdh = t7.hpdh update test set h1='j',h2='j',...,h7='j' where h1='k' //把所有k改为j
databasename:array[1..7]of string;
i:integer;procedure ..............
begin
databasename[1]:='表一的名字';
databasename[2]:='表二的名字';
.
.
. for i:=1 to 7 do
with table1 do
begin
close;
tablebame:=databasename[i];
open;
edit;
table1['hpbh']:='m';
post;
end;
end;暂时想到这个方法
2、使用Trigger修改,修改一个表,自动修改其他表,但效率也比较低。
create view test select t1.hpdh h1,t2.hpdh h2,...t7.hpdh h7 from t1,t2,...t7
where t1.hpdh=t2.hpdh and t1.hpdh=t3.hpdh and t1.hpdh = t4.hpdh ... and t1.hpdh = t7.hpdh update test set h1='j',h2='j',...,h7='j' where h1='k' //把所有k改为j