Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do you convert LONG to CLOB using PLSQL?

Posted on 2001-06-13
2
Medium Priority
?
1,089 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 200 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
How much do you know about the future of data centers? If you're like 50% of organizations, then it's probably not enough. Read on to get up to speed on this emerging field.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

824 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