记录集1:
Query原有的记录,(query是缓存的)
记录集2。
insert into aa selcet 'const1' As WorkNo, id, name, department,'2003-7-8' as leaveday from employee from department='工程部';要将记录集2的数据APPEND到Query的缓存中,最发不要用光标操作.
Query原有的记录,(query是缓存的)
记录集2。
insert into aa selcet 'const1' As WorkNo, id, name, department,'2003-7-8' as leaveday from employee from department='工程部';要将记录集2的数据APPEND到Query的缓存中,最发不要用光标操作.
while not query2.eof
begin
query1.append;
for i:=0 to query2.fieldcount-1 do
begin
query1.fields[i].asstring:=query2.fields[i].asstring;
end;
query1.post;
query2.next;
end;自己调试写写看。不保证正确。
2:循环前记录下某个唯一的字段数值,循环后locate定位
记得以前用BDE的LocalSQL时,可以将其他表中的记录直接的insert到一个TABLE控件的数据集中去,即将一个Table控件(TQUER控件也可)当一个本地数据庫中的一个表来用。如:
var table1:TTable;//table1.tablename='aa';
insert into aa(aa) value('aa');<====> inset int table1(aa) value('aa')