When we upgraded our products from SPC100 to SPC200, we needed to write SQL scripts to complete the database upgrade because the data types of the database table columns changed. The primary key column ID for table t_mobile_indvconfig needs to be changed from VARCHAR2 (100) to Number (17). You can refer to the following SQL:
--Name the original ID rename bak_idalter table t_mobile_indvconfig RENAME column ID to bak_id;--add a column with the same name as the original column ALTER TABLE T_mobile_ Indvconfig ADD ID Number (17); --Convert the data in bak_id to the newly added ID column update t_mobile_indvconfig SET id = CAST (bak_id as number (17));--delete the original column alter TABLE T_mobile_ Indvconfig DROP column bak_id;--sets the new column property, where the example is set to non-null alter TABLE t_mobile_indvconfig MODIFY (ID number (n) not NULL);-- Rebuilding the primary key, because the original ID column has been deleted, also needs to be rebuilt alter TABLE t_mobile_indvconfig ADD CONSTRAINT pk_sys_smsgate PRIMARY key (ID);
Modifying the data type of the primary key corresponding column of an Oracle database table