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 -> newbie question about inserting using cursors

newbie question about inserting using cursors

From: Nico Liever <nicoliever_at_yahoo.com>
Date: 7 Feb 2002 05:00:32 -0800
Message-ID: <d04d655.0202070500.6e6e6d21@posting.google.com>


Hi,

I'm using the following code to select a few records from one table and then insert them into another using a cursor.

 declare
 cursor people2_cur is
 select *
 from PEOPLE
 where SAL>2000;
 people2_rec PEOPLE2%ROWTYPE;
 begin
  for rec1 in people2_cur
   loop

	 insert into PEOPLE2 values(rec1.MNR, rec1.NAME, rec1.ADRES, rec1.CITY,rec1.SAL); 
	 exit when people2_cur%NOTFOUND;

   end loop;
 end;

Is it possible to use a more general value-description in the insert? Instead of using:
 insert into PEOPLE2 values(rec1.MNR, rec1.NAME, rec1.ADRES, rec1.CITY,rec1.SAL); something like :
 insert into PEOPLE2 rec1;
to insert the whole record rec1 ?

Thanks in advance,

Nico. Received on Thu Feb 07 2002 - 07:00:32 CST

Original text of this message

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