表一:salesman
salesid salesname
1 张三
2 李四
表二:sales
orderid salesid
1 1
2 2
uniquery1 sql
select s1.orderid,s1.salesid,s2.salesname
from sales s1 left outer join salesman s2
on s1.salesid=s2.salesid
当更改salesid时,使用select salesname from salesman where salesid=:salesid取得salesname去更新uniquery1的salesname
已经设置uniquery1的cacheupdates为真.
更新语句如下:
if not UniConnection1.InTransaction then begin
UniConnection1.StartTransaction;
try
UniQuery1.ApplyUpdates;
UniConnection1.Commit;
except
UniQuery1.CancelUpdates;
UniConnection1.Rollback;
end;
end;
问题:
1.如果不改salesid,不管改多少次,都没问题.
2.如果改salesid,第一次修改保存没问题,第二次改后保存时出现错误: connections is busy with results for another command
3.如果同时改多行的salesid,保存时问题与2一样.
4.使用UniUpdateSQL没有用.
salesid salesname
1 张三
2 李四
表二:sales
orderid salesid
1 1
2 2
uniquery1 sql
select s1.orderid,s1.salesid,s2.salesname
from sales s1 left outer join salesman s2
on s1.salesid=s2.salesid
当更改salesid时,使用select salesname from salesman where salesid=:salesid取得salesname去更新uniquery1的salesname
已经设置uniquery1的cacheupdates为真.
更新语句如下:
if not UniConnection1.InTransaction then begin
UniConnection1.StartTransaction;
try
UniQuery1.ApplyUpdates;
UniConnection1.Commit;
except
UniQuery1.CancelUpdates;
UniConnection1.Rollback;
end;
end;
问题:
1.如果不改salesid,不管改多少次,都没问题.
2.如果改salesid,第一次修改保存没问题,第二次改后保存时出现错误: connections is busy with results for another command
3.如果同时改多行的salesid,保存时问题与2一样.
4.使用UniUpdateSQL没有用.
使用如下更新,也是一样出现问题:
if not UniConnection1.InTransaction then begin
UniConnection1.StartTransaction;
try
UniQuery1.ApplyUpdates;
UniConnection1.Commit;
except
UniQuery1.RestoreUpdates;
UniConnection1.Rollback;
raise;
end;
UniQuery1.CommitUpdates;
end;
还是发现有不少bugs,恐怕最终还是得改用ado了
实在是郁闷
比如 unidac中 执行proc的 unistoredproc 第一次执行ok 第二次执行 就会报错 总是提示上一次执行的东西
csdn上发帖问了好久 也没人回复
估计unidac用的人不多吧。 具体也不清楚
还请大家指教。。