Oracle modifies the field type with data to char due to changes in requirements. The general idea is as follows: www.2cto.com will change the type of field name to backup, then add a field with the same name as the field name to change the type (the original field has been renamed), and then update the data, finally, delete the renamed backup field. The following operations are performed in Oracle 10.2.0.1.0. /* Modify the original field name */alter table name rename column field name TO field name 1; /* ADD a field with the same name as the original field */alter table name ADD field name VARCHAR2 (30);/* www.2cto.com
Update the original data to a new field. Be sure to display and convert the data type (different from MSSQL) */update table name SET field name = CAST (field name 1 AS VARCHAR2 (30);/* Delete the original backup field */alter table Name drop column field name 1;