我先用query查询一个表里边有字段dd类型为整型,table连接一个表,batchmove的source设置为query,目标table,执行这段代码总有问题!!!query1.close;
      query1.sql.clear;
      query1.sql.add('select C2126  from  C21  where GZ_YM=200301  and A_ID=1 AND A0188 in (Select A0188 From A01 Where'
                  +' Dept_id in (Select Dept_id From DeptCode where Parent Like :sa0 or Dept_Code=:sa1)'
                  +' and A0193=0 and A0199=0)');     query1.ParamByName('sa0').value:='0205%';
     query1.Parambyname('sa1').value:='0205';
     query1.open;  
    table1.active:=true;
    batchmove1.Execute;

解决方案 »

  1.   

    table1只有一个字段?是不是违反了数据库的约束。
    另外把设置为batchmove1.Mode:=batUpdate试试
      

  2.   

    执行时有什么错误提示吗?
    最大的可能是如楼上所讲的,table里只有一个字段,而加入的记录仲会有相同的,违反了约束
      

  3.   

    我的就是batchmove1.Mode:=batUpdate;
    table中不止一个字段,我是想一个一个字段的往table里放数,执行代码没提示错误,但执行后没有被更新,
      

  4.   

    query1里面要是查不出记录的话,那table里面也是没有被更新的
    首先要确认你的sql是有记录返回的