Solved

How do you convert LONG to CLOB using PLSQL?

Posted on 2001-06-13
2
1,038 Views
Last Modified: 2011-10-03
In a PL/SQL environment how do you trap a LONG value and apply it to a CLOB?  
0
Comment
Question by:Garnet99
2 Comments
 
LVL 5

Accepted Solution

by:
ser6398 earned 50 total points
ID: 6188464
Is this what you are looking for:

TO_LOB converts LONG or LONG RAW values in the column long_column to LOB values. You can apply this function only to a LONG or LONG RAW column, and only in the SELECT list of a subquery in an INSERT statement.

Before using this function, you must create a LOB column to receive the converted LONG values. To convert LONGs, create a CLOB column. To convert LONG RAWs, create a BLOB column.

See Also: INSERT for information on the subquery of an INSERT statement  
 
Example
Given the following tables:

CREATE TABLE long_table (n NUMBER, long_col LONG);
CREATE TABLE lob_table (n NUMBER, lob_col CLOB);


use this function to convert LONG to LOB values as follows:

INSERT INTO lob_table
  SELECT n, TO_LOB(long_col) FROM long_table;

0
 

Author Comment

by:Garnet99
ID: 6188479
Thanks, I actually found out how to do it after another hour of searching but yes that is exactly what I needed to know.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now