473,386 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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.

May 22 '06 #1
3 1621
shsandeep wrote:
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
May 22 '06 #2
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.
May 22 '06 #3
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.

May 23 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: J.Beaulieu | last post by:
Hi suppose that I have a set named 'my_set' wich contain 'aaa','bbb','ccc' and I want to alter with an sql command the structure to get 'ddd' in addition. How can I do that?
1
by: Alex Satrapa | last post by:
I have a table from which I'm trying to extract certain information. For historical reasons, we archive every action on a particular thing ('thing' is identified, funnily enough, by 'id'). So the...
1
by: nfrodsham | last post by:
In Microsoft's help literature, it states: "You can filter out non-unique rows by using the DISTINCT option of an aggregate function" I am trying to do this in Access 2003 with the COUNT...
3
by: Scott | last post by:
I am trying to alter the ForeColor of a TextBox object so that parts of the displayed text are written in various colors. For example, when writing to the TextBox I wish to display parts of the...
4
by: shsandeep | last post by:
1. I defined a distinct data type 'Surrogate_Key' using the below statement: set current schema Myschema; CREATE DISTINCT TYPE Surrogate_Key AS INTEGER WITH COMPARISONS; 2. Created a table that...
9
by: JimmyKoolPantz | last post by:
IDE: Visual Studio 2005 Language: VB.NET Fox Pro Driver Version: 9.0.0.3504 Problem: I currently have a problem altering a DBF file. I do not get any syntax errors when running the program. ...
1
by: RGow | last post by:
Hi, I'd like to know whether there is a way to alter the data type of a VARCHAR FOR BIT DATA column to be simply a VARCHAR column? I executed an ALTER TABLE statement, similar to, ALTER TABLE...
1
by: RussCRM | last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for...
1
by: ebusiness | last post by:
I am trying to create nicknames for tables in a remote database. The federated database and remote database are both DB2 UDB V8.2, both OS are AIX. Could anyone tell me how to create a nickname...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.