程序包主体-PLS-00905的Oracle错误:对象REV123无效

我正在尝试如下创建一个程序包。引用了Errors creating Oracle package bodyhttps://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万。

谢谢

mdxdr 回答:程序包主体-PLS-00905的Oracle错误:对象REV123无效

这是包的主体。没有包装规格就不可能存在。

在运行上述代码之前,请创建规范为

CREATE OR REPLACE PACKAGE rev123
is
  procedure p_get_x ( p_id  in NUMBER);
END;
/

然后

CREATE OR REPLACE PACKAGE BODY rev123
is
  procedure p_get_x ( p_id  in NUMBER)
  is
    cursor c_get_x is
    select ...
本文链接:https://www.f2er.com/2963354.html

大家都在问