这个问题可能要用动态游标来处理,你可以参考下面的方法试试:<br>PROCEDURE DEMO(pcardnumber varchar) IS<br> v_cursor number;<br> v_sqlstr varchar(2000);<br> v_card varchar2(3);<br> v_result integer;<br>BEGIN<br> v_sqlstr := 'Select card_number From table Where card_number in (' || pcardnumber || ') ' ||<br> 'Order by card_number';<br><br> v_cursor := dbms_sql.open_cursor; <br> dbms_sql.parse(v_cursor, v_sqlstr, dbms_sql.native);<br> dbms_sql.define_column(v_cursor, 1, v_card, 3); <br> ...;<br> v_result := dbms_sql.execute(v_cursor);<br> v_result := dbms_sql.fetch_rows(v_cursor);<br> ...;<br> while True loop<br> dbms_sql.column_value(v_cursor, 1, v_card); --第一个卡号赋给 v_card<br> ...; --你自己的处理<br> end loop;<br> dbms_sql.close_cursor(v_cursor);<br>END DEMO;