Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / May 2006

Tip: Looking for answers? Try searching our database.

Altering a distinct data type

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shsandeep - 22 May 2006 08:39 GMT
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.
Serge Rielau - 22 May 2006 17:20 GMT
> 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
Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

shsandeep - 23 May 2006 00:45 GMT
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.
shsandeep - 23 May 2006 02:03 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.