insert  into  test(TestCode,)  应为
 insert  into  test(TestCode)不好意思

解决方案 »

  1.   

    if to_char(i) in (aCodeId) then 试试看,没测试,不小得对不对
      

  2.   

    或者传入类型改为 数值 类型然后,定义一个变量 aaaCodeId = substr(aCodeId,1,1)||','||substr(aCodeId,2,1)||','substr(aCodeId,3,1)||','substr(aCodeId,4,1)||','substr(aCodeId,5,1)||' ' if i in (aCodeId) then
    改为if i in (aaaCodeId) then
      

  3.   

    应该把aCordId 的数据解析出来,再做比对?
      

  4.   

    SQL> ed
    Wrote file afiedt.buf  1  declare test varchar2(100);
      2  begin
      3  test:='1,2,3,4,5';
      4          for i in 1..100 loop
      5             if instr(','||test||',',     ','||i||',')>0 then
      6               insert into t(a)
      7               values (i);
      8            end if;
      9          end loop;
     10*   end ;
    SQL> /PL/SQL procedure successfully completed.SQL> select * from t;         A
    ----------
             1
             2
             3
             4
             5这样改一下应该可以了
      

  5.   

    请问ORARichard(没钱的日子......) :
    instr(','||test||',',     ','||i||',')加','的目的是什么??是不是为了把||i||转换成字符处理?直接用instr(test,i)不可以吗??