SQL> set define offSQL> ALTER TABLE PMIS.RM_WRITTEN_EXAM_SCHEDULE
MODIFY(ADMIT_CARD_CONDITION NCLOB)ALTER TABLE PMIS.RM_WRITTEN_EXAM_SCHEDULE
MODIFY(ADMIT_CARD_CONDITION NCLOB)
Error at line 3
ORA-22858: invalid alteration of datatype
Script Terminated on line 3.
Solution: Just create a new field with desire data type and then alter the table to copy old field value and then drop the old field and then rename new field with old field .
ORA-22858: invalid alteration of datatype Solution.
ALTER TABLE RM_WRITTEN_EXAM_SCHEDULE ADD (NEW_1 NCLOB);
UPDATE RM_WRITTEN_EXAM_SCHEDULE SET NEW_1 = OLD_1;
ALTER TABLE RM_WRITTEN_EXAM_SCHEDULE DROP COLUMN OLD_1;
ALTER TABLE RM_WRITTEN_EXAM_SCHEDULE RENAME COLUMN NEW_1 TO OLD_1;
ALTER TABLE RM_WRITTEN_EXAM_SCHEDULE ADD (ADMIT_CARD_CONDITION_1 NCLOB);
UPDATE RM_WRITTEN_EXAM_SCHEDULE SET ADMIT_CARD_CONDITION_1 = ADMIT_CARD_CONDITION;
ALTER TABLE RM_WRITTEN_EXAM_SCHEDULE DROP COLUMN ADMIT_CARD_CONDITION;
ALTER TABLE RM_WRITTEN_EXAM_SCHEDULE RENAME COLUMN ADMIT_CARD_CONDITION_1 TO ADMIT_CARD_CONDITION;
No comments:
Post a Comment