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: easy way to convert a CLOB field to VARCHAR2?

Re: easy way to convert a CLOB field to VARCHAR2?

From: Terry Dykstra <dontreply_tdykstra_at_cfol.ab.ca>
Date: Tue, 21 Aug 2001 16:24:18 GMT
Message-ID: <SWvg7.63210$uM6.9380182@news1.telusplanet.net>


Use the dbms_lob() package to read the clob.

--
Terry Dykstra
Canadian Forest Oil Ltd.
"Andre Doehn" <a.doehn_at_gmx.net> wrote in message
news:9ltv2o$bdmnd$1_at_ID-71421.news.dfncis.de...

> dear list,
> what will be the easiest way to convert a CLOB field (with content)
> to an VARCHAR2 (850) field?
>
> 1. drop all constraints of TEST.TBL_1
> 2. rename TEST.TBL_1 to TEST.TBL_2
> 3. create table ... TEST.TBL_1 with a VARCHAR2 (850) field instead of a
CLOB
> field
> 4. import the rows from TEST.TBL_2 in TEST.TBL_1 doesn´t work with:
>
> BEGIN
> FOR rec IN
> (
> SELECT
> CLOB_FIELD
> FROM TEST.TBL_2) LOOP
> INSERT INTO TEST.TBL_1
> (
> VARCHAR2_FIELD
> )
> VALUES
> (
> rec.CLOB_FIELD
> );
> END LOOP;
> END;
>
> ok...this procedure doesn´t work because of type mismatch...
> is there another way to convert this field?
>
> Any way around this?
>
> Andre
>
>
Received on Tue Aug 21 2001 - 11:24:18 CDT

Original text of this message

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