过程名以及参数:CREATE OR REPLACE PROCEDURE S2ERPDEMO.VouchTempResult(VT_FlowTableID IN varchar)
VT_FlowTableID  是由多个FlowTableID串连接在一起的,例如 VT_FlowTableID:=‘2,3,4’; 下面我在调用时候的时候
select t1.* from table1 t1 where  t1.id in (VT_FlowTableID)t1.id是number(19)类型,这样我应该怎么转化? 

解决方案 »

  1.   

    动态语句result_cur sys_refcursor;begin
    open result_cur for 'select t1.* from table1 t1 where t1.id in'||vt_flowtableid||')';
      

  2.   

    ..t1.id in ('||..掉了个左括号
      

  3.   

    create or replace procedure testts(listports in varchar2)
    AS
          theSlot varchar2(50);
          theRate varchar2(50);     
          v_rc sys_refcursor;
    begin          
            open v_rc for 'select xtxx,xtbm from xtbm where xtbm in('||listports||')';     
      loop
          fetch v_rc into theSlot,theRate;
          exit when v_rc%notfound;
          dbms_output.put_line(theSlot || '  ***** ' ||  theRate);
      end loop;
      close v_rc;END testts;