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 > Alter Table and affect on functions

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-18-09, 08:39
phil72 phil72 is offline
Registered User
 
Join Date: Nov 2008
Posts: 41
Alter Table and affect on functions

Hi, when i try to alter table db2 would not let, because there are functions and procedures refering table. I have to drop the procedures/ functions and alter table and then redeploy procedures/ functions.
My procedures/ functions have specific name.

Is there a better way ?

Thanks in Advance
Reply With Quote
  #2 (permalink)  
Old 09-18-09, 09:14
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
It depends. How are you trying to alter the table? Also include your DB2 version and OS.

Andy
Reply With Quote
  #3 (permalink)  
Old 09-18-09, 09:39
phil72 phil72 is offline
Registered User
 
Join Date: Nov 2008
Posts: 41
DB2 9.7 and OS is Windows, i am trying to alter table from Control Center.
Reply With Quote
  #4 (permalink)  
Old 09-18-09, 09:42
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
What are you trying to alter? Maybe if you supply the statement you are trying to perform....

Andy
Reply With Quote
  #5 (permalink)  
Old 09-18-09, 11:09
phil72 phil72 is offline
Registered User
 
Join Date: Nov 2008
Posts: 41
i am try to change column from Character 6 to charcter 10 this column is used in function and removing one column this column is not used any procedure or function
Reply With Quote
  #6 (permalink)  
Old 09-18-09, 11:12
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Quote:
Originally Posted by phil72
Hi, when i try to alter table db2 would not let, because there are functions and procedures refering table. I have to drop the procedures/ functions and alter table and then redeploy procedures/ functions.
My procedures/ functions have specific name.

Is there a better way ?

Thanks in Advance
In light of what you are trying to do, this is the only way to do it.

Andy
Reply With Quote
  #7 (permalink)  
Old 09-18-09, 12:23
phil72 phil72 is offline
Registered User
 
Join Date: Nov 2008
Posts: 41
Thanks
one more question
i have column that is character type i want to convert it decimal
select CAST(mycol AS DECIMAL(8,4) ) from Admin.mytable
it gives error if column has character value like 'NONE', 'NA' etc, Is there a function to check if column is Not a number
Reply With Quote
  #8 (permalink)  
Old 09-18-09, 12:35
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
No built in function. You could make a UDF though.

Andy
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