--修改dishdetail字段名dishdetailback ALTER TABLE dispatch_dish RENAME COLUMN dishdetail TO dishdetailback; --创建一个dishdetail字段 类型是clob ALTER TABLE dispatch_dish ADD dishdetail clob; --把dishdetailback的值都放到dishdetail中 UPDATE dispatch_dish SET dishdetail =dishdetailback -- CAST(dishdetailback AS clob); --删除dishdetailback字段 ALTER TABLE dispatch_dish DROP COLUMN dishdetailback;
要把一个varchar2的字段修改成clob类型,前提是已存在的数据不能够改变。