我创建了一个如下所示的 SP: 目的是将 2 参数传递给 xyz。SP xyz 将从表 t1 中读取记录并存储在游标中。xyz 将依次在循环中调用另一个 SP sp2,并将记录存储在游标中。当我试图在 TOAD 中运行它时,我得到了错误
ORA-06550: line 2, column 3:
PLS-00201: identifier 'abc.xyz' must be declared
ORA-06550: line 2, column 3:
PL/SQL: Statement ignored
create or replace PROCEDURE abc.xyz(year IN number, ver IN number)
IS
cursor my_cur (year IN number, ver IN number) IS
select p1, p2, p3,
p4, p5, p6
from abc.t1
where p2=year
and p3=ver;
my_row my_cur%rowtype;
params varchar2(1000);
BEGIN
for IN my_cur(year, ver) loop
params := '' || my_row.p1 || '' ||','
|| my_row.p2 || ','
|| my_row.p3 || ','
|| my_row.p4 || ','
|| my_row.p5 || ','
|| '' || my_row.p6 || ''
dbms_output.put_line(params);
exec sp2(params);
params := '';
end loop;
END;