Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 Oracle PL/SQL: Convert LONGs to LOBs Jump to:  
Category: >> Oracle PL/SQL >> Convert LONGs to LOBs Bookmark and Share

<< 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;
 
 


Free
Oracle Magazine
Subscriptions
and Oracle White Papers


SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 65 users online    © 2009 psoug.org

PSOUG LOGIN
Username: 
Password: 
Forgot your password?