W
wugr
Unregistered / Unconfirmed
GUEST, unregistred user!
在Delphi中如何使用临时表?我的后台数据库是Informix7.23,我想使用Informix 中temp
临时表的功能,但是Delphi好象不能象ec一样将用户写的sql当成一个用户线程使用,这样
我用Query写的sql在execsql以后,上一个sql插入的临时表在下一个sql就不识别了。使用
Delphi的TDatabase中的事务也解决不了,请求大家帮忙。
假设有如下的sql,我想利用临时表关联:
select deptcode,countercode,count(*) goodsamount
from gds_goodscode
group by 1,2
into temp tmp_goodstocounter;
select deptcode,countercode, sum(salemoney) salemoney
from gds_osale
group by 1,2
into temp tmp_goodssale;
select a.deptcode,a.countercode,a.goodsamount,b.salemoney
from tmp_goodstocounter a,tmp_goodssale b
where a.deptcode = b.deptcode and a.countercode = b.countercode
into temp tmp_iwanttoget;
临时表的功能,但是Delphi好象不能象ec一样将用户写的sql当成一个用户线程使用,这样
我用Query写的sql在execsql以后,上一个sql插入的临时表在下一个sql就不识别了。使用
Delphi的TDatabase中的事务也解决不了,请求大家帮忙。
假设有如下的sql,我想利用临时表关联:
select deptcode,countercode,count(*) goodsamount
from gds_goodscode
group by 1,2
into temp tmp_goodstocounter;
select deptcode,countercode, sum(salemoney) salemoney
from gds_osale
group by 1,2
into temp tmp_goodssale;
select a.deptcode,a.countercode,a.goodsamount,b.salemoney
from tmp_goodstocounter a,tmp_goodssale b
where a.deptcode = b.deptcode and a.countercode = b.countercode
into temp tmp_iwanttoget;