Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old May 22nd, 2006, 08:45 AM
shsandeep
Guest
 
Posts: n/a
Default Altering a distinct data type

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.

  #2  
Old May 22nd, 2006, 05:25 PM
Serge Rielau
Guest
 
Posts: n/a
Default Re: Altering a distinct data type

shsandeep wrote:[color=blue]
> Can a distinct data type be altered?
>
> Eg: Suppose 'Surrogate_Key' is defined as CHAR(1).
> Can it be altered to CHAR(2)?[/color]
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
  #3  
Old May 23rd, 2006, 12:45 AM
shsandeep
Guest
 
Posts: n/a
Default Re: Altering a distinct data type

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.


  #4  
Old May 23rd, 2006, 02:05 AM
shsandeep
Guest
 
Posts: n/a
Default Re: Altering a distinct data type

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.

 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles