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!

When should be package invalidated?

xxsawerSep 21 2012 — edited Sep 21 2012
Hello guys,
I would need again some help...
My question is: When exactly should be package invalidated?

Consider following situation:
We have two packages, one contains constants (in its specification), the other is reading these constants. Package is reading these constants in package body and package spec as well. Now, when I add a new constant to the first package and recompile it, should this invalidate the other package??? The new added constant is not used in the other package.
In reality, we have a Constant package, containing all constants in its specification. One package (test_pkg) is reading some constant let say form line 100. Now we add new constant let say to line 50. When we recompile the constant package, planty of packages get invalidated because they are reading from it. We recompile all invalid packages. However test_pkg is not invalidated!!! Now if we run the code from test_pkg, it is still reading the constant from line 100, so it is reading it from wrong place and the constant has wrong value! The only thing what help is to recompile the test_pkg.
So it looks like the reference to Constant package wasn't updated.
Why isn't test_pkg invalidated???

Oracle version:
SELECT * FROM V$VERSION;

Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
"CORE	11.2.0.1.0	Production"
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 19 2012
Added on Sep 21 2012
3 comments
426 views