If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > drop procedure or udf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-01-04, 07:38
rafsantos rafsantos is offline
Registered User
 
Join Date: Nov 2004
Posts: 5
drop procedure or udf

Hi,

I am porting a big application from Oracle 8i to DB2 8.2 for Linux and we have more than 300 stored procedures and functions to port. Among some normal problems, we are facing a big one.

As we need to change procedures and UDFs a lot of times, we have to drop these objects and create them again (in Oracle there is a "create or replace procedure" option). But, in order to drop a procedure, we need to drop all the dependent objects. If one UDF has 30 dependencies, we'll have to drop all of them and create them again. It's a lot of work...

If it's right, we are going to have more problems, because this will impact in loosing access to these objects (GRANTs) and we'll have to grant all the privileges in all these procedures again.

Is there a solution to this situation?

thanks,
Reply With Quote
  #2 (permalink)  
Old 12-01-04, 08:21
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
We are using V8.1 which basically works the same as 8.2. For recreating UDFs, I wrote a java program that will drop the dependant objects (UDFs, Views, and Stored Procedures). Then recreate them all in the proper order. Actually it does this for Views and SPs as well. If I just change a SP and other SPs are dependant on it, they will just be marked invalid (syscat.packages.valid <> 'Y'). These are easily fixed by using REBIND on them. As for dealing with the rights issue, V8.1 and 8.2 have a neat way to do this: GRANT EXECUTE ON PROCEDURE myschema.* to group mygroup. This will grant the execute rights on all current AND FUTURE procedures, functions, and methods in the schema provided.

HTH

Andy
Reply With Quote
  #3 (permalink)  
Old 12-07-04, 07:43
rafsantos rafsantos is offline
Registered User
 
Join Date: Nov 2004
Posts: 5
ok,
thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On