我正在尝试如下创建一个程序包。引用了Errors creating Oracle package body和https://www.guru99.com/packages-pl-sql.html的引用。
CREATE OR REPLACE PACKAGE BODY rev123
is
procedure p_get_x ( p_id in NUMber)
is
cursor c_get_x is
select
rst.id,rst.col1,rst.col2
from REV_STAGE_TBL rst
where not exists (select 1 from rev_tbl_1 fed
where rst.id = fed.id);
t_get_x c_get_x%rowtype;
begin
open c_get_x;
fetch c_get_x bulk collect into t_get_x ;
close c_get_x;
for idx in 1 .. t_get_x.count
loop
insert into rev_tbl_2
(
id,col1,col2
)
values (
t_get_x(idx).id,t_get_x(idx).col1,t_get_x(idx).col2
);
end loop;
commit;
end p_get_x;
end rev123;
/
错误:
show error;
Package body REV123 compiled
Errors: check compiler log
Errors for PACKAGE BODY REV123:
LINE/COL ERROR
-------- --------------------------------------------------------------------
0/0 PL/SQL: Compilation unit analysis terminated
1/ PLS-00905: object REV123 is invalid
1/ PLS-00304: cannot compile body of 'REV123' without its specification
要复制的行总数为500万。
谢谢