I have a column details designed as varchar in oracle DB, this DB is being used now for customers and some rows already have data stored.
Now I want to change the column details to a Clob column. What is a smart way to accomplish this?
But that is not the case with changing VARCHAR2 to CLOB. The difference between the 2 types is that in VARCHAR2 you have to specify the length of the stored string and that length is limited to 4000 characters while CLOB can store up to 128 terabytes of character data in the database.
(as the previous answer) and here's the code:
ALTER TABLE atable ADD (tmpdetails CLOB); UPDATE atable SET tmpdetails=details; COMMIT; ALTER TABLE atable DROP COLUMN details; ALTER TABLE atable RENAME COLUMN tmpdetails TO details;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With