Select N_S into N_S_DATA from ben_sve_merge where CELLCODE = v_code;   
这里是不是返回多行了
查一下cellcode是否有重复
select cellcode from ben_sve_merge group by cellcode having count(1)>1;

解决方案 »

  1.   

    Select N_S into N_S_DATA from ben_sve_merge where CELLCODE = v_code;你这个查询是不是有多个纪录值。
      

  2.   

    很有可能是以下语句返回了多条记录导致报错:Select N_S into N_S_DATA from ben_sve_merge where CELLCODE = v_code; 
      

  3.   

    没有  后面加where  查询出来就一条数据 
      

  4.   

    貌似加上where 后面 加上  rownum =1 就是正确的 
      

  5.   


    create or replace procedure pro_1
    is
    cursor cs is  select * from tablebegin
         for c in cs loop
         begin
         insert into table (列) values (c.列);
         end;
         end loop;
         
    end;上面是OK
    create or replace package body T_Package as
    procedure T_Data(p_out_cursor out refCursorType) is
    mycur refCursorType;
    cursor cs is  select * from table
    begin
         for c in cs loop
         begin
         insert into table (列) values (c.列);
         end;
         end loop;
    end
    error!   why?
      

  6.   

    cursor cs is  select * from table后面加上分号包体定义后面少个end;
      

  7.   


    create or replace package body T_Package ASprocedure T_Data is
    cursor cs is  select * from emp;
    begin
         for c in cs loop
         begin
         insert into emp_test (empno,ename,job,mgr) values (c.empno,c.ename,c.job,c.mgr);
         end;
         end loop;
         COMMIT;
    END T_Data;
    END T_Package;你报的是什么错误,我简化一下,是可以执行的
      

  8.   

    where条件过滤后多于一条数据
      

  9.   

    直接
    insert into table (xxx,xxx,xxx) select xxx,xxx,xxx from table不行么,为什么要用游标?