Re: long to varchar2

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 22 Sep 1999 21:10:20 -0400
Message-ID: <uX3pN6+=WEjYNe=xVsF7bFeHzRhD_at_4ax.com>


A copy of this was sent to brenogomes_at_my-deja.com (if that email address didn't require changing) On Wed, 22 Sep 1999 23:49:07 GMT, you wrote:

>I successfully performed migration from FoxPro 2.5 files to Oracle
>8.0.4.0.0.
>
>Fox memo fields were converted to long. All data are plain text, with
>500 characters or less, due 254 fox limits.
>
>In the new application it would better to use Varchar2(1000) instead
>Long. How could I read data from long and write to Varchar2 ?
>

begin

   for x in ( select * from TABLE_WITH_LONG ) loop

       insert into TABLE_WITHOUT_LONG 
       values ( x.c1, x.c2, x.c3, ..., x.LONG_COLUMN );
   end loop;
end;

will do it. plsql can deal with longs upto 32k and will convert them into varchar2's for you.

>I appreciate your suggestions.
>
>Thanks in advance.
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.

-- 
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Thu Sep 23 1999 - 03:10:20 CEST

Original text of this message