Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: How do I copy LONG columns between tables?

Re: How do I copy LONG columns between tables?

From: Darren M. <offroadbiker_at_hotmail.com>
Date: Fri, 24 Nov 2000 14:28:57 GMT
Message-ID: <JWuT5.27438$kd.5950390@news3.rdc1.on.home.com>

Stefan,

You can use varchar2 if the data in the long field will be less than 2000 characters. (On Oracle 8, you can go to 4000 char.)

I have also done something like this in the past to copy long columns between tables. I haven't written pl/sql for a while, so I've put comments where I forget the syntax:

declare

cursor cur_elements1 is
select id_, elt_
from elements1;

var_id_ elements1.id_%type;
var_elt_ elements1.elt_%type;

begin

insert into elements2(id_, elt_)
values (var_id_, var_elt_);

end;

-Darren

"Stefan Larsson" <d95stela+news_at_dtek.chalmers.se> wrote in message news:slrn91ssp5.srr.d95stela+news_at_licia.dtek.chalmers.se...
> Hi!
>
> I have run across a few problems when using the LONG datatype in
> Oracle 7.3.4.
>
> I have two tables:
>
> CREATE TABLE Elements1
> id_ INTEGER,
> elt_ LONG
> );
>
> and Elements2 which looks exactly the same.
>
> Oracle won't let me copy data between the tables with
> statements like
>
> INSERT INTO Elements2
> SELECT id_, elt_ FROM Elements1;
>
> because the LONG datatype is not allowed in insert select lists,
> in fact, the LONG datatype seems to be disallowed almost everywhere.
>
> What solutions exists? Should I use a table with varchar entries instead?
>
> /stefan
Received on Fri Nov 24 2000 - 08:28:57 CST

Original text of this message

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