在过程里面 用的参数吗 ?
create or replace procedure  zsf0525 ( r in varchar)
....
select * from table1 where field1 in (r)
........你试试看 ,不晓得可不可以

解决方案 »

  1.   

    参考一下这个贴子:
    http://community.csdn.net/Expert/topic/4005/4005325.xml?temp=.8659784
    或许有你要的
      

  2.   

    zsfww1205(在帮助别人中学习,在学习中帮助别人) 
    你说的这种方式用过了,不行,查不出东西来
      

  3.   

    你可以这样来作
    string sql ;
    sql.printf("select * from table1 where field1 in ('%s','%s'','%s')",value1,value2,value3);这样sql中就是你所要的select语句
      

  4.   

    SQL> create or replace type mytabletype as table of VARCHAR2(1000);类型被创建SQL> 
    SQL> create or replace function strtab(p_str in varchar2)
      2  return mytabletype
      3  as
      4  lstr varchar2(1000) default p_str||',';
      5  ln   number;
      6  ldata   mytabletype:=mytabletype();
      7  begin
      8  loop
      9   ln:=instr(lstr,',');
     10   exit when (nvl(ln,0)=0);
     11   ldata.extend;
     12   ldata(ldata.count):=ltrim(rtrim(substr(lstr,1,ln-1)));
     13   lstr:=substr(lstr,ln+1);
     14  end loop;
     15  return ldata;
     16  end;
     17  /函数被创建SQL> select * from aa where cc in(select * from table(cast(strtab('11,12,13') as mytabletype)));         AA          CC          BB
    ----------- ----------- -----------
             11          11          11SQL>