Oracle Convert long to lob

Convert long to lob

•Create a new table using lob. Make sure to preserve constaints, triggers, grants, and indexes.
CREATE TABLE lob_tab(id NUMBER, clob_col CLOB);
•Use INSERT and TO_LOB function to convert:
INSERT INTO lob_tab
SELECT id,
TO_LOB(long_col)
FROM long_tab;
•DROP TABLE long_tab;
•CREATE SYNONYM long_tab FOR lob_tab;

This entry was posted in oracle. Bookmark the permalink.