sqltemp:='insert into tempp (uni_no,item_name,price) select uni_no,item_name,price from product where uni_no like '+''''+'%'+edit3.Text+'%'+''''+'and item_name like '+''''+'%'+edit4.Text+'%'+''''+' and author like '+''''+'%'+edit5.Text+'%'+'''';
dm.sdt.Active:=false;
dm.Sdt.DataSet.CommandText:=sqltemp;
dm.Sdt.Execute;
sql1:='';
sql1:='select *  from abc a,tempp b where a.uni_no=b.uni_no and a.date>='+''''+edit1.text+''''+' and a.date<='+''''+edit2.text+'''';
dm.sdt.Active:=false;
dm.sdt.DataSet.CommandText:=sql1;
dm.sdt.Active:=true;
其中tempp是临时表,怎么查不出来数据.请高手指点一下.

解决方案 »

  1.   

    1. 首先 你看看 
    "select uni_no,item_name,price from product where uni_no like '+''''+'%'+edit3.Text+'%'+''''+'and item_name like '+''''+'%'+edit4.Text+'%'+''''+' and author like '+''''+'%'+edit5.Text+'%'+''''; 
    有没有数据。2,建议写成 #temp,3,这样的结构最好放在存储过程里面,
      

  2.   

      oracle 里没有像sql server里一样的临时表的#temp 你应该创建一个表作为临时表
      

  3.   

    oracle的临时表和一般表在sql里的写法没什么区别(除了建表的命令不一样).我想是不是第二句的dm.sdt.Active:=false; 
    造成,如果是那应该怎么写?