Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Converting LONG to CLOB

Re: Converting LONG to CLOB

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Wed, 4 Dec 2002 12:07:44 -0000
Message-ID: <3dedf011$0$715$ed9e5944@reading.news.pipex.net>


try
create table tmp_tab
as
select id,to_lob(logfield)
from mytable;

drop table mytable;
rename tm_tab to mytable;

--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer

******************************************
"Paul Taylor" <paul.taylor_at_zen.co.uk> wrote in message
news:ksoruuku5m9dtt0r1ldd0trjvi522ko3m5_at_4ax.com...

> I want to convert a column from LONG to CLOB but I get an error:
>
> ORA-22858: invalid alteration of datatype
>
> I'm using Oracle 8.1.7 under Linux.
>
> This is what I'm doing:
>
> ALTER TABLE mytable MODIFY (longfield CLOB);
>
> and the table is:
>
> CREATE TABLE mytable(ID int, longfield LONG);
>
> Then I tried creating a new column of type CLOB and attempted to copy
> the LONG into it but get the error:
>
> ORA-00932: inconsistent datatypes
>
> Here's what I'm doing:
>
> UPDATE mytable SET clobfield = TO_LOB(longfield )
>
> Can anyone help me out with these problems? Thanks.
>
>
>
>
Received on Wed Dec 04 2002 - 06:07:44 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US