467,883 Members | 1,223 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,883 developers. It's quick & easy.

Replacing a function referenced in a view

I have several user defined functions which get called from triggers.
Is it possible to install a new version of the functions without
having to drop and recreate the triggers? When I try to recreate the
function (by DROPping and CREATEing), I get the error

SQL0478N DROP or REVOKE on object type "FUNCTION" cannot be processed
because there is an object "MY_TRIGGER", of type "VIEW or SUMMARY
TABLE",
which depends on it. SQLSTATE=42893

Thanks for any advice.
Nov 12 '05 #1
  • viewed: 1502
Share:
2 Replies
I don't think I'd want to do that. If I used a function in a trigger to
populate a column which is indexed; then changing the function could
easily change its output which would invalidate the index contents.
Dropping the trigger wouldn't fix the index but would hopefully give the
DBA a clue that more issues can arise from the function change.

Phil Sherman
Bruce wrote:
I have several user defined functions which get called from triggers.
Is it possible to install a new version of the functions without
having to drop and recreate the triggers? When I try to recreate the
function (by DROPping and CREATEing), I get the error

SQL0478N DROP or REVOKE on object type "FUNCTION" cannot be processed
because there is an object "MY_TRIGGER", of type "VIEW or SUMMARY
TABLE",
which depends on it. SQLSTATE=42893

Thanks for any advice.


Nov 12 '05 #2
Bruce,

Teh answer today is: No.
You will need to drop the trigger, change your function and then
recreate it.
In DB2 V8.2 you can try DB2LK_DEP_OF() to tell you objects dependent on
the one to change.

Cheers
Serge
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by rmm | last post: by
11 posts views Thread by Paul Reddin | last post: by
4 posts views Thread by John | last post: by
7 posts views Thread by Mike | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.