Solved

how to drop a procedure/function without dropping the dependencies

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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 demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 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