View previous topic :: View next topic
|
Author |
Message |
perez_a
New User
Joined: 02 Feb 2006 Posts: 25 Location: Italy
|
|
|
|
HI FRIENDS,
IS POSSIBLE TO CHANGE THE TYPE OF A COLUMN?
EX:
LEVEL CHAR (02) ---------------> LEVEL DECIMAL (2, 0)
PLEASE HELP ME!!!
BYE ALEX |
|
Back to top |
|
|
Jag
New User
Joined: 07 Dec 2005 Posts: 30 Location: India
|
|
|
|
Hi,
I think this change is not possible..How ever i will check it once again..
Mean while if you are in hurry...There is solution always..
Create a new coulmn with the new data type and copy the old column to the new coulmn and delete the old column..
Cheers,
Jag |
|
Back to top |
|
|
sri.mainframes
New User
Joined: 16 Feb 2006 Posts: 29 Location: MUMBAI
|
|
|
|
Hi parez
yes definetly we can change type of a column in db2
see the below example
ALTER TABLE <tablename>
ALTER COLUMN <columnname>
SET DATATYPE <newdatatype>
please correct me if i am wrong.
Thanks
sri.prince |
|
Back to top |
|
|
r2k1984
New User
Joined: 21 Jun 2005 Posts: 69 Location: chennai
|
|
|
|
U CAN HAVE THE COMMAND BY MODIFY
ALTER TABLE TABLE NAME MODIFY COLOUMN COLUMNTYPE COLOUMN COLOUMNTYPE.
alter table ram modify address char(2) no decimel(2,0);
iam not sure please check it |
|
Back to top |
|
|
krish_mrt
New User
Joined: 15 Apr 2005 Posts: 12 Location: Chennai
|
|
|
|
Hi..
The ALTER TABLE statement as specified by sri.mainframes will work only if the existing datatype and the data type to be replaced are of compatible types...
And so, i dont think we can change from CHAR to DECIMAL...
If there are any issues in this pls get back.. |
|
Back to top |
|
|
|