Solved

how to drop a procedure/function without dropping the dependencies

Posted on 2011-03-09
5
1,002 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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 (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

746 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

11 Experts available now in Live!

Get 1:1 Help Now