Solved

how to drop a procedure/function without dropping the dependencies

Posted on 2011-03-09
5
1,008 Views
Last Modified: 2012-05-11
Hi,

  I'm on Db2 UDB 8.2
  I have a fucntion, which is calling a stored procedure inside it.
  I made changes to the function and tried to compile it, when it said, it cannot drop it as it has a dependency as the stored procedure. Soon i realized that there are a number of other functions that use this function and so, they all depend on this function.

  I'm not changing any of the dependencies. Can i force drop this function and re-create it without dropping all the dependencies?

  Please advise.
0
Comment
Question by:pvsbandi
  • 2
  • 2
5 Comments
 
LVL 37

Expert Comment

by:momi_sabag
ID: 35085390
how about just altering the function instead of dropping and creating it?
0
 

Author Comment

by:pvsbandi
ID: 35085449
Thanks! Sorry, i wrote it reverse..
  I have to modify the stored procedure which is called by many functions.
  Can we force drop the procedure after the change?
0
 
LVL 45

Accepted Solution

by:
Kdo earned 500 total points
ID: 35085715
Hi bandi,

DB2 keeps track of object dependencies.  Think of it as "referential integrity" on the database, if you will.

You can not drop objects that other objects require, even if your intentions are good.  DB2 won't let you take the database into this invalid condition.  (SQL Server will, but that's hardly a good reason to use SQL Server.)

You'll need to remove the dependencies, or change the parent object with an ALTER statement.


Good Luck,
Kent
0
 

Author Closing Comment

by:pvsbandi
ID: 35085909
Thanks Kent!
0
 
LVL 37

Expert Comment

by:momi_sabag
ID: 35090031
i also said you should alter it... :-)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now