data type conversion
Hi, a table in production server has a column with data type of number. But now the developers want it to change to varchar. My question is the table has data, how to convert its data type of the column when it already contains data of number data type.
Last edited by iris; 08-23-2010 at 03:48 PM.
1- Take an export of the affected table -as a backup
2- Create a new varchar2() column as needed.
3- Update new varchar2() column from old number column
4- Check everything is okay with data in new varchar2() column
5- Drop old number column
6- Rename new varchar2() column to the name old number column used to have.
Pablo (Paul) Berzukov
Author of Understanding Database Administration
available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Click Here to Expand Forum to Full Width