Oracle® TimesTen In-Memory Database SQL Reference Release 11.2.1 Part Number E13070-03 |
|
|
View PDF |
The ALTER PACKAGE statement explicitly recompiles a package specification, package body, or both. Explicit recompilation eliminates the need for implicit runtime recompilation and prevents associated runtime compilation errors.
This statement recompiles all package objects together. You cannot use the ALTER PROCEDURE or ALTER FUNCTION statement to individually recompile a procedure or function that is part of a package.
Required privilege
No privilege is required for the package owner.
ALTER ANY PROCEDURE for another user's package.
SQL syntax
ALTER PACKAGE [Owner.]PackageName COMPILE [PACKAGE|SPECIFICATION|BODY] [compiler_parameters_clause […]] [REUSE SETTINGS]
Parameters
The ALTER PACKAGE statement has the parameters:
Parameter | Description |
---|---|
[Owner.]PackageName |
Name of the package to be recompiled. |
COMPILE |
Required clause used to force the recompilation of the package specification, package body, or both. |
[PACKAGE|SPECIFICATION|BODY ] |
Specify PACKAGE to recompile both the package specification and the body. Specify SPECIFICATION to recompile the package specification. Specify BODY t o recompile the package body.
|
compiler_parameters_clause |
Use this optional clause to specify a value for one of the PL/SQL persistent compiler parameters. The PL/SQL persistent compiler parameters are PLSQL_OPTIMIZE_LEVEL, PLSCOPE_SETTINGS and NLS_LENGTH_SEMANTICS.
You can specify each parameter once in the statement. If you omit a parameter from this clause and you specify |
REUSE SETTINGS |
Use this optional clause to prevent TimesTen from dropping and reacquiring compiler switch settings. When you specify REUSE SETTINGS , TimesTen preserves the existing settings and uses them for the compilation of any parameters for which values are not specified. |
Description
When you recompile a package specification, TimesTen invalidates local objects that depend on the specification, such as procedures that call procedures or functions in the package. The body of the package also depends on the specification. If you subsequently reference one of these dependent objects without first explicitly recompiling it, then TimesTen recompiles it implicitly at runtime.
When you recompile a package body, TimesTen does not invalidate objects that depend on the package specification. TimesTen first recompiles objects upon which the body depends, if any of those objects are invalid. If TimesTen recompiles the body successfully, then the body become valid.
When you recompile a package, both the specification and the body are explicitly recompiled. If there are no compilation errors, then the specification and body become valid. If there are compilation errors, then TimesTen returns an error and the package remains invalid.
See also