Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
CHANGE TYPE COLUMN

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
perez_a

New User


Joined: 02 Feb 2006
Posts: 25
Location: Italy

PostPosted: Thu Apr 13, 2006 8:06 pm    Post subject: CHANGE TYPE COLUMN
Reply with quote

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
View user's profile Send private message

Jag

New User


Joined: 07 Dec 2005
Posts: 30
Location: India

PostPosted: Fri Apr 14, 2006 7:11 am    Post subject:
Reply with quote

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
View user's profile Send private message
sri.mainframes

New User


Joined: 16 Feb 2006
Posts: 29
Location: MUMBAI

PostPosted: Mon Apr 17, 2006 12:30 pm    Post subject:
Reply with quote

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
View user's profile Send private message
r2k1984

New User


Joined: 21 Jun 2005
Posts: 69
Location: chennai

PostPosted: Mon Apr 17, 2006 4:59 pm    Post subject:
Reply with quote

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
View user's profile Send private message
krish_mrt

New User


Joined: 15 Apr 2005
Posts: 12
Location: Chennai

PostPosted: Thu May 25, 2006 5:52 pm    Post subject: Re: CHANGE TYPE COLUMN
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Setting Font Type for XMIT satish.ms10 All Other Mainframe Topics 3 Fri Sep 15, 2017 10:01 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us