Quick Search:
 Oracle PL/SQL: Convert LONGs to LOBs Jump to:  
Category: >> Oracle PL/SQL >> Convert LONGs to LOBs  

<< lastnext >>

Snippet Name: Convert LONGs to LOBs

Description: Converts LONG datatypes to LOBs. You can also use the same procedure to convert LONG RAW datatypes to BLOBs.

Comment: Oracle 8.1.x or above

Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 03rd, 2009

CREATE TABLE old_long_table(c1 NUMBER, c2 LONG);
INSERT INTO  old_long_table VALUES (1, 'LONG data to convert to CLOB');
CREATE TABLE new_lob_table(c1 NUMBER, c2 clob);
-- Use TO_LOB function to convert LONG to LOB...
INSERT INTO  new_lob_table
       SELECT c1, TO_LOB(c2) FROM old_long_table;

   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org