Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: LONG datatype error
You'll need a pl/sql block, something along the line of:
declare
cursor select_cursor is select * FROM mytable ;
begin
for A in select_cursor loop
insert into anothertable values (A.col1, A.longcolumn );
end loop;
end;
/
-- Terry Dykstra Canadian Forest Oil Ltd. "Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message news:ofqa7u4bp8chrv9p715n14hq1iin0db449_at_4ax.com...Received on Fri Feb 22 2002 - 12:16:30 CST
> On Wed, 20 Feb 2002 21:57:25 -0000, "Peter Hrstich"
> <peteandjill_at_ractonrdlondon.freeserve.co.uk> wrote:
>
> >When inserting a LONG datatype column value from one table into a LONG
> >datatype column of another table I get the following message :-
> >
> >ORA-00997 illegal use of LONG datatype
> >
> >The description for this in the Oracle doco is the following
> >
> >Cause: A value of datatype LONG was used in a function or in a DISTINCT,
> >WHERE, CONNECT BY, GROUP BY, or ORDER BY clause. A LONG value can only be
> >used in a SELECT clause.
> >
> >Action: Remove the LONG value from the function or clause.
> >
> >However I am only doing a simple SELECT of the value as part of a normal
> >insert statement.
> >
> >I am running Oracle 8i on a UNIX box (not that I would think this should
> >make any difference).
> >
> >Can anyone help with this?
> >
> >Rgds
> >Pete
> >
>
> However I am only doing a simple SELECT of the value as part of a
> normal
> insert statement.
>
> Here you go : This is not allowed with LONGs.
> The LONG can only be used in a standalone select.
>
> If you have 8i and this is a new application I'm not sure why you are
> using them in the first place, as they have been superseded by LOBs
> and are supported by Oracle only for reasons of backwards
> compatibility.
>
> Hth
>
>
>
> Sybrand Bakker, Senior Oracle DBA
>
> To reply remove -verwijderdit from my e-mail address