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: Converting LONG type to VARCHAR2...

Re: Converting LONG type to VARCHAR2...

From: Konstantin V Sartakov <skv_at_kpbank.ru>
Date: 1997/04/08
Message-ID: <33499684.7F00@kpbank.ru>#1/1

Hi.

try to do this(in SQL*Plus):

DECLARE
   buf VARCHAR2(2000);
   CURSOR c1_cur IS

      SELECT A1
        FROM A;

BEGIN
   OPEN c1_cur;
   LOOP
   FETCH c1_cur INTO buf;
   EXIT WHEN c1_cur%NOTFOUND;
   INSERT INTO B(B1)
   VALUES(buf);
   END LOOP;
END;
/
commit;

TinHa wrote:
>
> Hi:
> Can someone please tell me how can I convert a LONG Datatype to VARCHAR2 ?
>
> I have the following tables:
>
> Table Name Fields Type
> ==============================================
> A A1 LONG
>
> B B1 VARCHAR2(2000)
>
> When I executed the following SQL in Oracel SQL Worksheet:
> Insert into B select A1 from A
>
> It returns the : illegal use of LONG datatype
> error message.
>
> Thanks in advance
>
> Kevin Mei

 Regards

-- 
-------------------------------
         Konstantin V. Sartakov
                Kuzbassprombank
                       Kemerovo
                         Russia
           mailto:skv_at_kpbank.ru
Received on Tue Apr 08 1997 - 00:00:00 CDT

Original text of this message

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