Because of the demand change. Now you want to change the field type of a type number (8,2) to Char.
General ideas such as the following:
Rename the field name of the type you want to change to back up. Then add a field that has the same name as the field name of the type you want to change (the original field has been renamed). Then update the data, and finally delete the field that renamed the backup.
The following operations are passed in Oracle 10.2.0.1.0.
/* Change 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);
/*
Update the original data to the new field
This is to be noted. Be sure to show data type conversions (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;
Oracle Churn field type