Normally, it’s not possible to change the column datatype with the existing data.
Steps:
1. Add New temp Column with desired datatype.
SQL> Alter Table
Add temp datatype(size);
2. Update the data into new column.
SQL> Update
set temp =
3. Drop the original Column.
SQL> Alter table
Drop column
4. Rename the new column to original Name.
SQL> Alter table
rename column temp to
Note:- change the table_name, datatype, Original_columnname and size
No comments:
Post a Comment