Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Converting LONG type to VARCHAR2...
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.ruReceived on Tue Apr 08 1997 - 00:00:00 CDT