Solved

How to do Insert Into/Select with CLOB Columns?

Posted on 2014-11-20
4
458 Views
Last Modified: 2014-11-20
Dear Experts,

Could you confirm whether below SQL is valid or not, or could you please offer me an alternative?

Table TA (x number, y number, z clob)
Table TB (a number, b number, c varchar, d varchar, e varchar)

insert into TA (x,y,z,) select a, b, to_clob(concat(concat(c,d),e)) from TB;

BR
0
Comment
Question by:GurcanK
  • 2
  • 2
4 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 40455568
No need for to_clob:

insert into TA (x,y,z,) select a, b, concat(concat(c,d),e)  from TB;;

Since you keep asking "SQL is valid or not", again, set up a simple test and try it.
0
 

Author Comment

by:GurcanK
ID: 40455571
What happens if I put to_clob? Table TB has no CLOB fields.
0
 

Author Comment

by:GurcanK
ID: 40455576
I think you mean implicit conversion.
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40455611
>>What happens if I put to_clob?

Nothing.

>>Table TB has no CLOB fields.

So?  You are inserting varchar2 objects into a CLOB field.  That is just fine.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

733 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