Home » RDBMS Server » Server Administration » changing one datatype to another
changing one datatype to another [message #227935] Fri, 30 March 2007 04:27 Go to next message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
Hi,
I want to change a column from numeric to alphanumeric. Can it be performed with truncating that column?
Note:
i don't have any key column in that table

Thanks,
Shahnaz.
Re: changing one datatype to another [message #227938 is a reply to message #227935] Fri, 30 March 2007 05:28 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

If you try to alter the column with data.
You will get
ORA-01439: column to be modified must be empty to change datatype
Re: changing one datatype to another [message #227943 is a reply to message #227938] Fri, 30 March 2007 06:00 Go to previous message
martijn
Messages: 286
Registered: December 2006
Location: Netherlands
Senior Member
As a workaround you can:
1) add an extra column with the data-type required
2) update the new column (use some conversion probably) with old column
3) drop the old column

Hope it helps Smile
Previous Topic: drop tablespace problem
Next Topic: DBA entry book
Goto Forum:
  


Current Time: Thu Dec 05 08:25:22 CST 2024