how to drop a procedure/function without dropping the dependencies

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.
pvsbandiAsked:
Who is Participating?
 
Kent OlsenData Warehouse Architect / DBACommented:
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
 
momi_sabagCommented:
how about just altering the function instead of dropping and creating it?
0
 
pvsbandiAuthor Commented:
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
 
pvsbandiAuthor Commented:
Thanks Kent!
0
 
momi_sabagCommented:
i also said you should alter it... :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.