我先用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;
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;
解决方案 »
- 对不同窗体的语句能否统一?
- fastreport打印数据库中数据
- 花了一年时间学VB.准备转学delphi.
- 点击A窗口的button1按纽打开B窗口,在B窗口中输入完资料后点“保存”,但B窗口有时能自动关闭,有时却又不能,为什么?
- 系统托盘的问题,大家帮忙解决一下
- 谁有《Delphi深度历险》的电子版图书 ,请发至:[email protected] 送50分
- 年底散分!顺便问题:请列出免费下载有关“分布式系统”书籍的网址?UP都有分,口水越多得分数越多!!!
- 几个问题怎么没人回答?
- 请大家帮帮我!我是初学者
- 如何横版打印form?
- 为什么我复制文件的命令在2000下能用,而到98到不行了呢?
- oracle连接问题!!!! 在先等!
另外把设置为batchmove1.Mode:=batUpdate试试
最大的可能是如楼上所讲的,table里只有一个字段,而加入的记录仲会有相同的,违反了约束
table中不止一个字段,我是想一个一个字段的往table里放数,执行代码没提示错误,但执行后没有被更新,
首先要确认你的sql是有记录返回的