Updating an individual procedure in an Oracle package
Using Oracle 10g.
I'm writing a script to apply the delta changes made on our development system to our stage system.
Is there a way to modify or insert an individual procedure within a package without including the entire package contents in my script? I t开发者_运维问答hink the answer is no, but I wanted to be sure because it's going to be pretty ugly to have to include the entire contents of any modified packages when the changes were small.
Sorry but your gut instinct is correct. The unit of change is the PACKAGE BODY.
Not sure why you think it's ugly though. surely it's just a matter of calling a script for the package?
No, a package body must be replaced as a whole. Rather than include the code for several packages in a single script, I would create a file per package spec and a file per package body. You can then write a "meta-script" to run the required package changes in SQL Plus:
@@package1.spc
@@package1.bdy
@@package2.bdy
Faced same problem. Simply created separate package for a procedure that changes frequently.
精彩评论