Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Ccompar BLOB (images of type jpg) on ... nihad DB2 0 Sun Feb 05, 2017 3:13 pm
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 6 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us