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

Home -> Community -> Usenet -> c.d.o.server -> Re: long to clob conversion.

Re: long to clob conversion.

From: Yass Khogaly <ykhogaly_at_us.oracle.com>
Date: Mon, 19 Jul 1999 08:48:18 -0700
Message-ID: <7mvdr4$q53$1@inet16.us.oracle.com>

You cannot change a column's datatype to a LOB or REF datatype, therefore you must create a new column using the statements in the solution description

You need to create a new column of the desired type.Copy the current column data to the new type using the appropriate type constructor.

Use the following steps:


  1. ALTER TABLE table_name ADD (new_column_name new_datatype);
  2. UPDATE table_name SET new_column_name = old_column_name;

-OR-

2. INSERT INTO table_name (new_column_name)

     VALUES (SELECT old_column_name FROM table_name)
     WHERE (see note below);

     NOTE: Use a join condition to join the sub-query to the outer query.

3. If you do not want to retain the old column data you will have to create

    a new table and copy the data from the old table, then drop the old     table. You could then rename the new table to the old table name for     consistency.

I hope you find this of some help!

Regards

"The Views expressed here are my own and not necessarily those of Oracle Corporation"

John Wang <wang_john_at_bah.com> wrote in message news:7md90r$5jr$1_at_autumn.news.rcn.net...
> Hi, all:
>
> I have a table that has a long data type in 7.3.3 database. Now, I am
> trying to convert it to a clob datatype in oracle 805. How do I do it? I
> actually have a 8i database. To_lob function in 8i converted it
correctly.
> But 805 does not have it. If I use exp80 to import 8i dump, i get
> "unrecognized statement in the export file". If I use exp80 to export the
> 8i database, I get "invalid column name". Does anyone know how to convert
a
> long to clob?
>
> thanks
>
> jw.
>
>
Received on Mon Jul 19 1999 - 10:48:18 CDT

Original text of this message

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