Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Converting LONG to CLOB
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...Received on Wed Dec 04 2002 - 06:07:44 CST
> 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.
>
>
>
>
![]() |
![]() |