大概的存储过程是这样的,这里写个demo
求大神帮忙看看怎么解决为找到数据问题。
begin
while a +1 <=b loop
sql := 'select a,b from Z';
execute immediate sql into a,b;
sql := 'insert into X values(a,b)';
execute immediate sql;
a = a + 1;
end loop;
exception
when others then
dbms_output.out_line(sqlerr);
end;
求大神帮忙看看怎么解决为找到数据问题。
begin
while a +1 <=b loop
sql := 'select a,b from Z';
execute immediate sql into a,b;
sql := 'insert into X values(a,b)';
execute immediate sql;
a = a + 1;
end loop;
exception
when others then
dbms_output.out_line(sqlerr);
end;
![](http://imgsrc.baidu.com/forum/w%3D580/sign=7aec63ced21b0ef46ce89856edc551a1/59a6fbdcd100baa1133f6c5b4710b912c9fc2e5e.jpg?v=tbs)