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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Insert using LONG data type

Re: Insert using LONG data type

From: Rick Muffler <rmuffler_at_mema.mail.fedex.com>
Date: 1997/11/26
Message-ID: <347C3E0E.BFB5C40C@mema.mail.fedex.com>#1/1

The problem is with sqlplus restriction of not being able to handle longs. A short pl/sql procedure with a cursor should do the trick:

declare

	cursor b_cursor is select * from b;
	a_rec a%rowtype;
begin
	open b_cursor;
	fetch b_cursor into a_rec;
	while b_cursor%FOUND loop
		insert into a values
			(a_rec.x, a_rec.y, a_rec.z)
		commit;
		fetch b_cursor into a_rec;
	end loop;

end;
/

hope that helps,
rick

Allen Stennett wrote:
>
> I am having problems inserting using a "LONG" datatype. Here is an
> example
>
> INSERT INTO A(x,y,z)
> select x,y,z
> from B;
>
> I get an error saying misuse of LONG data type if "x" in table A and
> Table B are both longs. I cannot see anything in the Oracle books that
> I have read that this should be a problem. There are some restrictions
> using a LONG data type but I don't see one using it with an INSERT
> except you can't use it in the "where" clause.
>
> Thanks
  Received on Wed Nov 26 1997 - 00:00:00 CST

Original text of this message

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