Oracle8i SQL Reference Release 2 (8.1.6) A76989-01 |
|
SQL Statements (continued), 12 of 17
To explicitly recompile a stand-alone stored procedure. Explicit recompilation eliminates the need for implicit run-time recompilation and prevents associated run-time compilation errors and performance overhead.
To recompile a procedure that is part of a package, recompile the entire package using the ALTER PACKAGE
statement (see "ALTER PACKAGE").
Note:
This statement does not change the declaration or definition of an existing procedure. To redeclare or redefine a procedure, use the |
The ALTER PROCEDURE
statement is quite similar to the ALTER FUNCTION
statement (see "ALTER FUNCTION").
The procedure must be in your own schema or you must have ALTER ANY PROCEDURE
system privilege.
schema |
is the schema containing the procedure. If you omit schema, Oracle assumes the procedure is in your own schema. |
procedure |
is the name of the procedure to be recompiled. |
|
causes Oracle to recompile the procedure. The
For information on how Oracle maintains dependencies among schema objects, including remote objects, see Oracle8i Concepts. |
|
instructs the PL/SQL compiler to generate and store the code for use by the PL/SQL debugger. For information on debugging procedures, see Oracle8i Application Developer's Guide - Fundamentals. |
To explicitly recompile the procedure CLOSE_ACCT
owned by the user HENRY
, issue the following statement:
ALTER PROCEDURE henry.close_acct COMPILE;
If Oracle encounters no compilation errors while recompiling CLOSE_ACCT
, CLOSE_ACCT
becomes valid. Oracle can subsequently execute it without recompiling it at run time. If recompiling CLOSE_ACCT
results in compilation errors, Oracle returns an error and CLOSE_ACCT
remains invalid.
Oracle also invalidates all dependent objects. These objects include any procedures, functions, and package bodies that call CLOSE_ACCT
. If you subsequently reference one of these objects without first explicitly recompiling it, Oracle recompiles it implicitly at run time.
|
![]() Copyright © 1999 Oracle Corporation. All Rights Reserved. |
|