如果存到数据库中的数据是:1,2,3,4,那么
储过程中,定义变量为varchar2(n),就可以了

解决方案 »

  1.   

    oracle中''-〉'
    或者chr(39)
    '''1'',''2'',''3'',''4'''
      

  2.   

    我现在如下处理,可游标中为何没记录呢?(FOR,End Loop的过程没执行)变量都定义好了。
    psms_school_send('#13828865473#,#13922334455#,#13826334216#,#13933886679#',1,'afafafafa 广州一中')
    vchMobilestr接收第一个实参。Cursor curSchool(School number,Mobilestr varchar2) is select Mobile from T_SMSCHOOLSTUDENT where Mobile in ( Mobilestr ) and IsRecvMsg='1' and SCHOOL_NUM=School;
    ...
    vchOfMobilestr:= replace(vchMobilestr,'#',chr(39));
    FOR rowSchool IN curSchool(numOfSchool,vchOfMobilestr) LOOP
                 ....
             END LOOP;
      

  3.   

    这样是不行的
    除非是动态执行sql语句
    str:='select... where col in('||t_in||')';
    execute immediate str into t_tb;
    ...
      

  4.   

    参考这个贴子:
    http://expert.csdn.net/Expert/topic/2213/2213656.xml?temp=.3120844