Home » SQL & PL/SQL » SQL & PL/SQL » Query to copy columns from one table to another table
Query to copy columns from one table to another table [message #364768] Wed, 10 December 2008 00:26 Go to next message
ashamg2k
Messages: 18
Registered: October 2007
Junior Member
Hi All,

I have a table test1 which has a column view_text1 of long data type.

But i am not able to query this column using the like operator.
select * from test1 where view_text1 like '%V%'

As a workaround i created another table test2 which has a column view_text2 of varchar2(4000)

Now i want to copy the view_text1 column data of test1 table to view_text2 column of test2 table.

Please let me know what query should i write.

Thanks in advance,
Asha
Re: Query to copy columns from one table to another table [message #364773 is a reply to message #364768] Wed, 10 December 2008 00:36 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
As a workaround i created another table test2 which has a column view_text2 of varchar2(4000)

Create it with a lob column and use TO_LOB function to copy.

Regards
Michel
Re: Query to copy columns from one table to another table [message #364779 is a reply to message #364768] Wed, 10 December 2008 00:39 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9104
Registered: November 2002
Location: California, USA
Senior Member
Use to_lob and a clob column:

http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28393/adlob_long_lob.htm#i1018656

Michel beat me by 3 minutes.

[Updated on: Wed, 10 December 2008 00:40]

Report message to a moderator

Re: Query to copy columns from one table to another table [message #364786 is a reply to message #364768] Wed, 10 December 2008 00:54 Go to previous message
delna.sexy
Messages: 941
Registered: December 2008
Location: Surat, The Diamond City
Senior Member
One more thing,

Quote:

But i am not able to query this column using the like operator.



One can not use WHERE on LONG type column.
Previous Topic: execute immediate with select
Next Topic: Splitting string into records
Goto Forum:
  


Current Time: Thu Feb 06 14:26:14 CST 2025