Is there a way to rename an oracle procedure, without having to drop and recreate the procedure?
To rename a stored procedureExpand Databases, expand the database in which the procedure belongs, and then expand Programmability. Determine the dependencies of the stored procedure. Expand Stored Procedures, right-click the procedure to rename, and then click Rename. Modify the procedure name.
So you can load code using "Loas in Editor" option, change name of package and then execute script. It will create new package with new name.
If you really need to use a new name for the function without simply recreating the function with the new name change you might be able to take advantage of: SQL> create or replace synonym f2 for f1; Synonym created.
Use the RENAME statement to rename a table, view, sequence, or private synonym. Oracle Database automatically transfers integrity constraints, indexes, and grants on the old object to the new object.
UNfortunately there is no equivalent of ALTER TABLE ... RENAME
TO for PL/SQL objects. So I'm afraid you will have to drop the procedure and create it afresh with the new name....
... unless using a SYNONYM will resolve your bind. Without knowing why you want to change the procedure name it's a bit difficult to give advice.
A way around this would be using a procedure inside a package. Then you might use CREATE OR REPLACE PACKAGE ...
and CREATE OR REPLACE PACKAGE BODY ...
to achieve your goal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With