PSRLN_LIST VARCHAR2;PSRLN_LIST是一个字符串,而非数组,所以出错。

解决方案 »

  1.   

    create or replace procedure UP_AAA
    (
          PSRLN_LIST VARCHAR2    
    )
    is 
      
    begin        
         execute immediate 'update aaa set try_count=try_count-1 where srln in ('||PSRLN_LIST||')';
         Commit;
    end UP_AAA;
      

  2.   

    非常感谢各位的回答,动态SQL的方法可行。请问有什么方法能够动态返回Cursor吗
      

  3.   

    看一下我这个方法
    create or replace procedure UP_AAA
    (
          PSRLN_LIST VARCHAR2    
    )
    is 
      
    begin        
         update aaa set try_count=try_count-1 where instr(PSRLN_LIST,srln) > 0;
         Commit;
    end UP_AAA;
      

  4.   

    create or replace procedure UP_AAA
    (
          PSRLN_LIST VARCHAR2    
    )
    is 
      
    begin        
         execute immediate 'update aaa set try_count=try_count-1 where srln in ('||PSRLN_LIST||')';
         Commit;
    end UP_AAA;
    --------------------------------------
    这个方法存在sql 注入的危险
      

  5.   

    嗬嗬,一般动态sql都存在sql注入的危险,如果没有特别处理判断过的话