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;
这里是不是返回多行了
查一下cellcode是否有重复
select cellcode from ben_sve_merge group by cellcode having count(1)>1;
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?
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;你报的是什么错误,我简化一下,是可以执行的
insert into table (xxx,xxx,xxx) select xxx,xxx,xxx from table不行么,为什么要用游标?