dbTalk Databases Forums  

Altering a distinct data type

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss Altering a distinct data type in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
shsandeep
 
Posts: n/a

Default Altering a distinct data type - 05-22-2006 , 02:39 AM






Can a distinct data type be altered?

Eg: Suppose 'Surrogate_Key' is defined as CHAR(1).
Can it be altered to CHAR(2)?

And will the changes be automatically propagated to all columns that use
'Surrogate_Key' data type?

Thanks.

Cheers,
San.


Reply With Quote
  #2  
Old   
Serge Rielau
 
Posts: n/a

Default Re: Altering a distinct data type - 05-22-2006 , 11:20 AM






shsandeep wrote:
Quote:
Can a distinct data type be altered?

Eg: Suppose 'Surrogate_Key' is defined as CHAR(1).
Can it be altered to CHAR(2)?
No. You need to drop.
An interesting question is whether you can alter a table in DB2 Viper to
remove the distinct type to the base type, then alter the table as you
say to char(2) and then turn it back into the (meanwhile dropped an
recreated) distinct type... hmmm.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab


Reply With Quote
  #3  
Old   
shsandeep
 
Posts: n/a

Default Re: Altering a distinct data type - 05-22-2006 , 06:45 PM



Ok, lets take an example.
1. Suppose 2 tables use the 'Surrogate_Key' distinct data type (defined as
char(1))

2. Now, I drop it.

3. I recreate the data type with the same name 'Surrogate_Key' but as
char(2)

4. Will the 2 tables automatically start using the Surrogate_Key with
char(2) or will there be any error?

Cheers,
San.



Reply With Quote
  #4  
Old   
shsandeep
 
Posts: n/a

Default Re: Altering a distinct data type - 05-22-2006 , 08:03 PM



I need to drop the table before dropping the distinct data type.
No use for me....
will have to use the conventional data types!

Cheers,
San.


Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.