Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Package Spec getting INVALID by Alter table

KarkiApr 30 2017 — edited Apr 30 2017

Hi All,

I want to know why package specification is going INVALID with ALTER TABLE when there are no reference to table.

SQL> create or replace package pkg_test_2 as

  2  procedure p_test;

  3  end;

  4  /

Package created.

SQL> create or replace package body pkg_test_2 as

  2    procedure p_test is

  3  v_ename varchar2(20);

  4   begin

  5      select empname into v_ename from emp33 where empno=10;

  6  dbms_output.put_line(' EMPNAME '||v_ename);

  7   end;

  8   end;

  9  /

Package body created.

SQL> alter table emp33 drop (c1);

Table altered.

SQL> select object_name, object_type, status from user_objects where object_name = 'PKG_TEST';

OBJECT_NAME          OBJECT_TYPE         STATUS

-------------------- ------------------- -------

PKG_TEST             PACKAGE             INVALID

PKG_TEST             PACKAGE BODY        INVALID

SQL> desc emp33;

Name                                      Null?    Type

----------------------------------------- -------- ----------------------------

EMPNO                                              NUMBER(38)

EMPNAME                                            VARCHAR2(20)

SALARY                                             NUMBER

Thanks

Karki

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2017
Added on Apr 30 2017
2 comments
595 views