Scenario: I know nothing about packages except that they contain functions and procedures all wrapped into a nice little present. So today I was given this package (rather large) with the instructions of “here, this is broken please fix it”.
I finally cleaned it all up, which brings me to my questions.
In the overall view of a package, that is going to be exported.
1) Other than a collection of everything does a package serve any other purpose?
2) To deploy this package do you need to set up the deployment space to already have all of the views/materialized views/ and tables that the package called? If not I am assuming the package will fail to execute.
3) Can you code the package to skip functions and procedures it fails to execute on without bombing out?
4) When taking a package that successfully compiled in one place to another place what other things should I be aware of?
1) Other than a collection of everything does a package serve any other purpose?
Other than that, it reduces the need to recompile other procedures that are dependant on a specific procedure when the specific procedure is altered.
Consider an (ordinary, not package wise)
procedure XYZ(a in number)that is called by many other procedures. If this procedure is altered, all the other procedures need to be recompiled which might reduce the availablity of the system.On the other hand, if the procedure is declared in a
packageand defined in apackage bodyand the procedure is changed in the body only, (almost) no recompiling takes place.2) To deploy this package do you need to set up the deployment space to already have all of the views/materialized views/ and tables that the package called? If not I am assuming the package will fail to execute.
No, you can install a
package bodywithout the dependant views or tables in place. The state of the package body will then beINVALIDand no functionality of the package body can be used.3) Can you code the package to skip functions and procedures it fails to execute on without bombing out?
Not sure, what the question is exactly. If the state of the package body is INVALID, no code can be executed, hence no “bombing out” can happen.
However, if the bombing out occurs for a logical reason (such as a division by zero for example) you can always resort to the
exception when others thenconstruct.4) When taking a package that successfully compiled in one place to another place what other things should I be aware of?
Again, not sure what you mean here. Could you elaborate what one place is? A schema? An instance? An installation, a company….?