Oracle7 Server SQL Reference
DROP FUNCTION
Purpose
To remove a stand-alone stored function from the database.
Prerequisites
The function must be in your own schema or you must have DROP ANY PROCEDURE system privilege.
If you are using Trusted Oracle7 in DBMS MAC mode, your DBMS label must match the function's creation label or you must satisfy one of the following criteria:
- If the function's creation label is higher than your DBMS label, you must have READUP and WRITEUP system privileges
- If the function's creation label is lower than your DBMS label, you must have WRITEDOWN system privilege.
- If the function's creation label and your DBMS label are not comparable, you must have READUP, WRITEUP, and WRITEDOWN system privileges.
Syntax
![](image096.gif)
Keywords and Parameters
schema is the schema containing the function. If you omit schema, Oracle7 assumes the function is in your own schema.
function
is the name of the function to be dropped.
Usage Notes
When you drop a function, Oracle7 invalidates any local objects that depend on, or call, the dropped function. If you subsequently reference one of these objects, Oracle7 tries to recompile the object and returns an error message if you have not recreated the dropped function. For more information on how Oracle7 maintains dependencies among schema objects, including remote objects, see the "Dependencies Among Schema Objects" chapter of Oracle7 Server Concepts.
You can only use this command to drop a stand-alone function. To remove a function that is part of a package, use one of the following methods:
- Drop the entire package using the DROP PACKAGE command.
- Redefine the package without the function using the CREATE PACKAGE command with the OR REPLACE option.
Example
The following statement drops the function NEW_ACCT in the schema RIDDLEY:
DROP FUNCTION riddley.new_acct
When you drop the NEW_ACCT function, Oracle7 invalidates all objects that depend upon NEW_ACCT.
Related Topics
CREATE FUNCTION command ![[*]](jump.gif)