我现在如下处理,可游标中为何没记录呢?(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;
这样是不行的 除非是动态执行sql语句 str:='select... where col in('||t_in||')'; execute immediate str into t_tb; ...
或者chr(39)
'''1'',''2'',''3'',''4'''
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;
除非是动态执行sql语句
str:='select... where col in('||t_in||')';
execute immediate str into t_tb;
...
http://expert.csdn.net/Expert/topic/2213/2213656.xml?temp=.3120844