IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Alter : Changing the datatype of a column.


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Mon May 28, 2007 3:14 pm
Reply with quote

Hi Guys,

Requirement : Currently there is a table with a column ref_no having datatype as integer. And the table holds one million records.
Now the reference number is going to be a character datatype (alpla numeric). I need to change the column from integer to character datatype.

Is it possible with out dropping the table and recreating with new datatype.
like using alter command.

i will be pleased with your advices...

Regards,
jai
Back to top
View user's profile Send private message
Nimesh.Srivastava

New User


Joined: 30 Nov 2006
Posts: 78
Location: SINGAPORE

PostPosted: Tue May 29, 2007 12:38 pm
Reply with quote

I dont think you can change the column attributes of table using alter command (exception char to varchar etc). What I may suggest is ADD a new column in the table using ALTER table and then run a mass update on the table to equate the NEW = CHAR(OLD).
And then use this NEW field in your code for all purposes
Thanks
Nimesh
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts DROP & ALTER PARTITION-PBR DB2 0
No new posts changing defaults in db2 admin - Unlo... DB2 0
Search our Forums:

Back to Top