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 > Does renaming of a table require recreating functions and procedures?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-22-11, 11:07
db2user24 db2user24 is offline
Registered User
 
Join Date: Nov 2007
Posts: 248
Does renaming of a table require recreating functions and procedures?

Hi,

Here is an interesting question -- I have this scenario in my database :

Table A ( with a lot of functions and procedures associated with it)

Table B ( same structure as Table A)


Here is what will happen --

Table A will be renamed to Table C
Table B will be renamed to Table A

Then the original Table A ( now Table C) will be dropped.

The question is if with the whole renaming process, will the functions and stored procedures have to be recreated? Thanks!
Reply With Quote
  #2 (permalink)  
Old 08-22-11, 11:52
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
I think the UDFs will need to be dropped before you do anything and recreated after you are done. The stored procedures should just have to have to be rebound. (see db2rbind to do them all at once).

Andy
Reply With Quote
  #3 (permalink)  
Old 08-22-11, 12:29
db2user24 db2user24 is offline
Registered User
 
Join Date: Nov 2007
Posts: 248
thanks, i thought so too..
Reply With Quote
  #4 (permalink)  
Old 08-22-11, 12:45
marc_ marc_ is offline
Registered User
 
Join Date: Aug 2011
Location: Glasgow, UK
Posts: 36
Why is this so? Is there a unique handle that DB2 uses for DB objects at compile time; therefore a renaming of a table will make no difference as the stored proc or UDF will always use that handle?
Reply With Quote
  #5 (permalink)  
Old 08-22-11, 13:05
db2user24 db2user24 is offline
Registered User
 
Join Date: Nov 2007
Posts: 248
I will experiment and see if it works without recreating the functions / procedures..will let you know what I find..
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