procedure SP_TBL_DICTIONARY_SELECT(
      p_indexcode          TBL_DICTIONARY.INDEXCODE%type,
      cur_OUT              out T_CURSOR
  )is
  begin
      open cur_OUT for
      select * from TBL_DICTIONARY d where d.indexcode in (p_indexcode)      
  end SP_TBL_DICTIONARY_SELECT;         p_indexcode参数的值是'PU001','PU002',存储过程这么写正确吗?

解决方案 »

  1.   

    这样试试看:
    open cur_OUT for
          'select * from TBL_DICTIONARY d where d.indexcode in (' || p_indexcode || ')';  
      

  2.   

    p_indexcode参数的值是'PU001','PU002',例如下面的赋值:p_indexcode  := '''PU001'',''PU002''';
      

  3.   

    也可以用instr
    select * from TBL_DICTIONARY d where instr(p_indexcode,d.indexcode)>0
      

  4.   

    select * from TBL_DICTIONARY d where d.indexcode in (p_indexcode) ,是可以的。但是不知道你定义变量的时候对不对,你可以直接定义varchar2就可以了。