Solved

how to drop a procedure/function without dropping the dependencies

Posted on 2011-03-09
5
1,025 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:
Kent Olsen 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

732 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