Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Create a new Stored Procedure in an Existing Package

I am new to using PL/SQL and I am trying to create a new stored procedure in an existing package. I realize that there is "CREATE OR REPLACE PACKAGE BODY," but does this mean that the entire body will be deleted once I add my new proc, or will it just append it on? (My proc name does not have the same name as any of the current procs).

like image 939
Johanna Avatar asked Jul 30 '11 17:07

Johanna


People also ask

Can you alter procedure with in package?

Because all objects in a package are stored as a unit, the ALTER PACKAGE statement recompiles all package objects. You cannot use the ALTER PROCEDURE statement or ALTER FUNCTION statement to recompile individually a procedure or function that is part of a package.

How do you create a new procedure?

To create a procedure in Object ExplorerIn Object Explorer, connect to an instance of Database Engine and then expand that instance. Expand Databases, expand the AdventureWorks2019 database, and then expand Programmability. Right-click Stored Procedures, and then click New Stored Procedure.


1 Answers

Unfortunately, to add a new procudure or function to an existing package, you must modify the original package and resubmit as a create or replace.

there is no method currently for adding to or removing from a package without modifying and resubmitting the whole package code.

http://forums.oracle.com/forums/thread.jspa?threadID=380898

like image 141
Bueller Avatar answered Oct 21 '22 13:10

Bueller