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

easy way to convert a CLOB field to VARCHAR2?

From: Andre Doehn <a.doehn_at_gmx.net>
Date: Tue, 21 Aug 2001 17:35:18 +0200
Message-ID: <9ltv2o$bdmnd$1@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 - 10:35:18 CDT

Original text of this message

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